glacier-upload
glacier-upload copied to clipboard
Unable to upload small files to glacier
I got the following error when uploading a file whose size is less than 4MB
botocore.errorfactory.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the UploadArchive operation: Invalid Content-Length: 0
This error happens at line 70 of upload.py
, which is body=file_to_upload,
.
The problem seems to be related to file_size = file_to_upload.seek(0, 2)
line in upload.py
.
Because after I change it to file_size = 1
, the problem no longer occurs.
replace
file_size = file_to_upload.seek(0, 2)
with
import os
file_size = os.stat(file_name[0]).st_size