One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
JimTR
4 years agoExplorer | Level 3
PHP cURL chunked upload
Hi
I have built a PHP to automate backups to dropbox amongst other things.
everything works well with the exception of chunked upload.
- No Errors are returned from dropbox at any point in the transaction
- I am using split to chunk the file into 50mb chunks
- run a foreach loop to upload the chunks via
"Dropbox-API-Arg: {\"cursor\": {\"session_id\": \"$session_id\",\"offset\": $offset},\"close\": false}";
where $session_id is the session id & $offset = the amount of the file uploaded in bytes
- then finish up with
"Dropbox-API-Arg: {\"cursor\": {\"session_id\": \"$session_id\",\"offset\": $offset},\"commit\": {\"path\": \"$upload_path\",\"mode\": \"overwrite\",\"autorename\": true,\"mute\": false}}";
$offset = total file size
- All endpoints are correct.
- The problem is the file is uploaded to Dropbox with no errors, Dropbox reports the file size correctly, so far so good, then if this file is a tar and you download it & try and view the archive, it opens fine but only contains the directory listing and no files
- if I reconnect all the chunks back together the archive reads fine so I can discount an error from the split utility
any ideas ?
- Greg-DB
Dropbox Staff
I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:
- the name and version number of the platform and SDK/library you are using, if any
- the steps to reproduce the issue, including relevant code snippet(s), but don't include any access token(s)- JimTRExplorer | Level 3
I am writing an app from scratch in php, but I found the issue,for anyone else the answer was to use fopen rather than gzopen
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 3 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!