total_bytes = os.stat('path/to/file').st_size
PROGRESS_BYTES = 0
def upload_callback(bytes, progress_bytes=PROGRESS_BYTES):
progress_bytes += bytes
sys.stdout.write('\r')
sys.stdout.write('part uploaded: %d of %d bytes' % (progress_bytes, total_bytes))
sys.stdout.flush()
with open(output_file, 'rb') as ouput_data:
s3.upload_fileobj(ouput_data, s3_bucket, s3_key, Callback=upload_callback)
Created
December 22, 2016 22:37
-
-
Save joseph-zhong/b7265bcfaeaf82a49b2c57e0d270f6c7 to your computer and use it in GitHub Desktop.
Boto3 Multipart upload
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment