Dropbox Python SDK 2.2.0 bug: commit_chunked_upload ?

Categories: Development NotesPython; Tagged with: ; @ August 2nd, 2015 23:04

Issue:  dropbox keep ignoring the first folder when committing a chunked upload:

After chunked uploading completed, commit the file by:

response = self.dropbox_client.commit_chunked_upload('/backup/docs.zip', upload_id, False)
remote_path = response['path']

My understanding was remote_path in the response should be same as the full_path I passed: ‘/backup/docs.zip’, however, the remote_path is: ‘docs.zip’. form client.py /commit_chunked_upload:

The full path to which the chunks are uploaded, *including the file name*.
If the destination folder does not yet exist, it will be created.

full path with filename, and it’ll be used by:

url, params, headers = self.request("/commit_chunked_upload/%s" % full_path,
                                    params, content_server=True)

a http request to : /commit_chunked_upload//backup/docs.zip will be sent. however, the actual server url is:

https://api-content.dropbox.com/1/commit_chunked_upload/auto/<path>

https://www.dropbox.com/developers/core/docs#commit-chunked-upload

Solution / workaround

1. fix the SDK :
Following CheckedUpload class,  the commit url can be generated by:

path = “/commit_chunked_upload/%s%s” % (self.client.session.root, format_path(path))

2. add ‘auto’ in the front of the remote path:

response = self.dropbox_client.commit_chunked_upload('auto/' + remote_path, upload_id, False)



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.