- Adding optional
total_bytes
argument toResumableUpload.initiate()
. This can be used to explicitly declare the size of the upload. Until this release, the upload size was determined implicitly by callingstream.seek(0, os.SEEK_END)
(i.e. seeking until the end of the stream). - Adding optional
stream_final
arguments toResumableUpload.initiate()
. Whenstream_final=False
(andtotal_bytes
is unset), the upload will be started with an unknown size. This can occur, e.g. if the resource is generated on the fly, such as application logs. Such uploads are considered "finished" when thestream
is exhausted and at that point the upload will send a content range header indicating completion to the server.
This feature was mentioned in the initial release notes as:
- Support for resumable uploads with size unknown when
initiate()
-d
PyPI: https://pypi.python.org/pypi/google-resumable-media/0.0.5
Docs: https://googlecloudplatform.github.io/google-resumable-media-python/0.0.5/