We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Jaume M.
10 years agoNew member | Level 1
Download a file with the API
Hi,
I'm a developer using the dropbox API to make a web integration.
I need to download a file using the api, but the options that I've found are not completely satisfactory for me:
I'm current...
mikezelton
8 years agoExplorer | Level 3
Hello Greg
I have a similar problem and I thought you might be able to help me.
I am trying to download a file from my dropbox folder using curl in mac os x terminal. For this I am using
https://www.dropbox.com/developers/documentation/http/documentation#files-download
If it is a .txt file I can get the content of the file in my terminal window. If it is an image I get something which does not make sense but I guess it is the content of the image. The question is, how can I actually save the .txt or .jpg file to my local drive? Does this command not auto-save the file to your default downloads folder?
Similary when I try to use download_zip for a folder nothing is downloaded but onyl some text that does not make much sense appears (although I get no error).
In contrast, when I use the upload feature, I just see the actual file added to my folder.
Many thanks
Mike
Greg-DB
Dropbox Community Moderator
8 years agomikezelton The Dropbox API download endpoints, e.g., /2/files/download and /2/files/download_zip, return the requested data in the response body. What you/your HTTP client do with that response is up to you.
By default, curl just shows the data in stdout. You may want to use curl's `--output` option to specify a location to save it to instead. I recommend referring to the curl documentation for more information on using it and the other options that curl offers.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!