Skip to content

minio-put.py doesn't work: Content Length is required #4

@k-furman

Description

@k-furman

Hello! Thanks for the project, it's very useful!

Trying to use minio-put.py script I get some errors arising from absence of the Content Length field in header.

This fix works for me:

diff --git a/minio-put.py b/minio-put.py
index 6df2534..bbb3668 100755
--- a/minio-put.py
+++ b/minio-put.py
@@ -38,6 +38,7 @@ def upload(key, secret, host, bucket, filename):
         'Host':          hostname,
         'Date':          date,                      # eg. Sat, 03 Mar 2018 10:11:16 -0700
         'Content-Type':  content_type,
+        'Content-Length': os.path.getsize(filename),
         'Authorization': f"AWS {key}:{signature}",
     }
     # import pprint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions