cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: PHP cURL chunked upload

PHP cURL chunked upload

JimTR
Explorer | Level 3

Hi 

I have built a PHP to automate backups to dropbox amongst other things.

everything works well with the exception of chunked upload.

  1. No Errors are returned from dropbox at any point in the transaction
  2. I am using split to chunk the file into 50mb chunks
  3. 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 ?
2 Replies 2

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)

JimTR
Explorer | 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  

Need more support?