One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
dalal_subhranil
8 years agoExplorer | Level 4
Copy file to local drive
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
- 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 7 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!