cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Download file through JS SDK

Download file through JS SDK

MaxEvan
New member | Level 2

I am currently working with your javascript sdk to retrieve a list of files from my dropbox using filesListFolder and I display the files as links on my page. I also use the filesDownload method to give my users the ability to download the files.

 

When a user clicks on a link, the browser's default download window (the one that asks you where you want to save the file) only appears when the file has finished downloading in the background and I then take the blob returned and manually start the download to the user's filesystem afterwards.

 

My problem is that I would like the default browser's download window to open when the user clicks on the link and not after the download has been completed. Do you think there is a way I could do that?

 

Thanks for your help!

2 Replies 2

Greg-DB
Dropbox Staff

I can't think of a way to do this using filesDownload. The filesDownload response block won't fire until the data is ready, so you can't build the URL from the blob until then, which you need to trigger the download.

 

You could use filesGetTemporaryLink instead though. That will directly return a URL you can pass along to the browser to download from. 

MaxEvan
New member | Level 2

Thank you very much for the answer, I will try that!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    MaxEvan New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?