You need to sign in to do that
Don't have an account?

aura component download file then open it
Hello All,
I have a SF Site with an aura component where I need the user to be able to click a link which downloads the file and then opens it. I have the file. I can either use it as a static resource or upload it to SF and use the link from the file. Right now when the use clicks the link it just opens the file. You then need to download the file and manually open the downloaded file. Is there a way to download the file on click and have it open after download?
Thank you,
P
I have a SF Site with an aura component where I need the user to be able to click a link which downloads the file and then opens it. I have the file. I can either use it as a static resource or upload it to SF and use the link from the file. Right now when the use clicks the link it just opens the file. You then need to download the file and manually open the downloaded file. Is there a way to download the file on click and have it open after download?
Thank you,
P
I think you can achieve your goal by adding the download attribute to the anchor tag
that attribute forces a file download dialog box to appear when the link to the file is clicked, then the user can manually go to their downloads folder and open the file.
I using the download attribute is not working on my Aura page
@ Phuc 2
Were you able to achieve it