上传进度回调

Callback for upload progress

我正在使用 Dropbox client for Python (actually a Python 3 version,但我认为现在不重要)将一些文件上传到我的 Dropbox。我也在使用 PyQt4 来为此创建一个 GUI。

是否可以指定上传文件时调用的回调以向用户显示上传进度?

你的意思是,你想在文件上传时显示进度(在进度条或其他东西上)? 你可能需要 get_chunked_uploader()

来自API Docs

DESCRIPTION Uploads large files to Dropbox in multiple chunks. Also has the ability to resume if the upload is interrupted. This allows for uploads larger than the /files_put maximum of 150 MB.

Typical usage:

1) Send a PUT request to /chunked_upload with the first chunk of the file without setting upload_id, and receive an upload_id in return.

2)Repeatedly PUT subsequent chunks using the upload_id to identify the upload in progress and an offset representing the number of bytes transferred so far.

3)After each chunk has been uploaded, the server returns a new offset representing the total amount transferred.

...