cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Copy file to local drive

Copy file to local drive

dalal_subhranil
Explorer | Level 4

How I can copy a file from user's dropbox account to servre using JS SDK. Previously we were using PHP SDK where user giving permission access app folder to our app. Then app was reading all files from user's dropbox account and copying those to server. We want to achive same using JS SDK. Want copy file from dropbox to local drive.

 

Thanks

1 Reply 1

Greg-DB
Dropbox Staff
If you want to download a file from Dropbox using the API v2 JavaScript SDK, you should use the filesDownload method:

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

There's an example of using sharingGetSharedLinkFile, which works similarly to filesDownload, here:

https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/download/index.html

For filesDownload, you would provide a file path instead of the URL.

In any case, note that JavaScript running in the browser doesn't have access to the local filesystem in general. The fileDownload method will give you the file data, but what you do with it from there is up to you. For example, the sharingGetSharedLinkFile method linked above allows the user to click a button to download it.
Need more support?
Who's talking

Top contributors to this post

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