Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
dghatch
4 years agoHelpful | Level 6
Download a file via API using PHP and cURL
Hi,
I am trying to download a file from my dropbox app, I have tried the cURL code in postman it works with no issues:
https://www.dropbox.com/developers/documentation/http/documentation#file...
- 4 years ago
I have now solved the issue, it turns out that the server (runing with DirectAdmin) was using an old version of curl (7.24.0) and when this was updated to 7.84.0 the problems was fixed.
Thanks again for all your help.
dghatch
4 years agoHelpful | Level 6
I think I have done it right this time (response headers this time):
HTTP/1.1 400 Bad Request
Content-Length: 14468
Content-Type: text/html
Vary: Accept-Encoding
X-Dropbox-Response-Origin: local
Date: Mon, 18 Jul 2022 17:11:48 GMT
Server: envoy
Connection: close
string(14672) "HTTP/1.1 400 Bad Request Content-Length: 14468 Content-Type: text/html Vary: Accept-Encoding X-Dropbox-Response-Origin: local Date: Mon, 18 Jul 2022 17:11:48 GMT Server: envoy Connection: close
I'm starting to think it's something else, not code. I have tried adding a random token and I get the same error.
Greg-DB
Dropbox Community Moderator
4 years agodghatch Thanks! It does seem like the request is getting malformed somehow. Have you inspected the exact values you're sending to https://content.dropboxapi.com/2/files/download? Make sure there's no extraneous data, in both the $token and $in_filepath values, as that could mangle the request, resulting in the generic error response.
- dghatch4 years agoHelpful | Level 6
Thanks for the help.
I have run the php file locally (XAMP) and it runs with no issues at all, so something on the server seems to be causing the issue, so I am now investigating this and I will update when/if I have more information.
- dghatch4 years agoHelpful | Level 6
I have now solved the issue, it turns out that the server (runing with DirectAdmin) was using an old version of curl (7.24.0) and when this was updated to 7.84.0 the problems was fixed.
Thanks again for all your help.
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!