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: 

Javascript API Clarity - filesDownload()

Javascript API Clarity - filesDownload()

abcd12341
Explorer | Level 3

I've been learning the Javascript API and am having a bumpy journey with filesDownload().

 

 

Looking at the docs...

 

http://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDownload__anchor

 

...the function is meant to be the way to download a file. However, the only arg it takes is one in which { path, rev } are specified. And the non-error response is a...

 

http://dropbox.github.io/dropbox-sdk-js/global.html#FilesFileMetadata

 

...which contains no fields that encapsulate the actual data being returned.

 

Upon inspection with a quick console.log() there is a 'fileBlob' field being returned but my concern is that directly accessing this field is an unsupported operation since it isn't listed in the FilesFileMetadata docs. Thus I'm concluding that either the docs are missing that field or that I haven't yet groked the intended workflow for downloading files (implying that the docs could be more helpful here).

1 Reply 1

Greg-DB
Dropbox Staff
Using 'fileBlob' in browser JavaScript (or 'fileBinary' in Node) is the correct way to access the file data itself. Apologies that this isn't better documented! I'll ask the team to clarify that in the docs.

There's an example of using that with a Content-Download style method like this here:

https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html#L53
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?