I am implementing this functionality in ReactJS, Application generated blob url
but I want to replace it with my custom file name. I tried but unfortunately was not able to achieve my goal could someone please help me thanks.
const blob = new Blob([res.data], { type: 'application/pdf' })
const blobUrl = URL.createObjectURL(blob)
var fileLink = document.createElement('a')
fileLink.href = fileLink
// it forces the name of the downloaded file
fileLink.download = 'pdf_name.pdf'
// triggers the click event
fileLink.click()
I implemented this code but when it get downloaded it showing Failed - no file