If you want to see a very simple Django demo project using this module, please take a look at django-chunked-upload-demo.
Installation
Install via pip:
pip install django-chunked-upload
And then add it to your Django INSTALLED_APPS:
INSTALLED_APPS= (
# ...'chunked_upload',
)
Typical usage
An initial POST request is sent to the url linked to ChunkedUploadView (or any subclass) with the first chunk of the file. The name of the chunk file can be overriden in the view (class attribute field_name). Example:
{"my_file": <File>}
In return, server with response with the upload_id, the current offset and the when will the upload expire (expires). Example:
Server will continue responding with the upload_id, the current offset and the expiration date (expires).
Finally, when upload is completed, a POST request is sent to the url linked to ChunkedUploadCompleteView (or any subclass). This request must include the upload_id and the md5 checksum (hex). Example:
请发表评论