top of page

Brainstorming - what are you missing?

Public·226 members

Jared Bass
Jared Bass

Download 590k Txt



I had a PDF file that was stored in S3 behind a Cloudfront URL. I wanted the user to be able to click a button and immediately initiate a download without popping open a new tab with a PDF preview. Generally, if a file is hosted at a URL that has a different domain that the site the user is currently on, immediate downloads are blocked by many browsers for user security reasons. If you use this solution, do not initiate the file download unless a user clicks on a button to intentionally download.




Download 590k txt



In order to get by this, I needed to fetch the file from the URL getting around any CORS policies to save a local Blob that would then be the source of the downloaded file. In the code below, make sure you swap in your own fileURL, Content-Type, and FileName.


Your browser or your browser's settings are not supported. To get the best experience possible, please download a compatible browser. If you know your browser is up to date, you should check to ensure that javascript is enabled. 041b061a72


About

This website is a work in progress and we would love to hear...

Members

© 2021 by People in Neeed under the project SMARTER Finance For Families. The project has received funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 847141.

 

 

 

Proudly created with Wix.com

SMARTER nudla text_edited.png
PIN_logo_en_250.png
bottom of page