Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
AdamHoover
12 months agoNew member | Level 1
libcurl upload
I'm trying to upload a file using libcurl. The code reports an OK upload, but the file does not appear. This is the equivalent curl command and it works: curl -X POST https://content.dropboxapi.co...
- 12 months ago
The 404 is from Dropbox and indicates that the request has not successfully reached a Dropbox API endpoint.
The issue is that you're sending a PUT, but you need to use POST to hit /2/files/upload. Please update your code to use POST and try again.
Greg-DB
Dropbox Community Moderator
12 months agoThe 404 is from Dropbox and indicates that the request has not successfully reached a Dropbox API endpoint.
The issue is that you're sending a PUT, but you need to use POST to hit /2/files/upload. Please update your code to use POST and try again.
AdamHoover
12 months agoNew member | Level 1
That worked, thanks. For future readers, libcurl defaults to PUT on CURLOPT_UPLOAD, and Dropbox requires POST. If you follow either libcurl's API description (https://curl.se/libcurl/c/CURLOPT_UPLOAD.html) or example (https://curl.se/libcurl/c/fileupload.html), you must insert this line after setting CURLOPT_UPLOAD:
curl_easy_setopt(curl, CURLOPT_POST, 1L);
The CURLOPT_UPLOAD option will reset it back to PUT if you don't order it this way.
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!