cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: Download file through JS SDK

Greg-DB
Dropboxer

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. 

Re: Download file through JS SDK

MaxEvan
New member | Level 2

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

Who's talking

Top contributors to this post

  • User avatar
    MaxEvan New member | Level 2
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?