Trying to generate pre-signed s3 upload url with below code:
response = s3_client.generate_presigned_post(
SOURCE_S3_BUCKET,
file_name,
Fields={"x-amz-meta-test-tag": "test-tag"},
Conditions=None,
ExpiresIn=3600,
)
After I got the response, I tried setting the x-amz-meta-test-tag in both form values and headers.
My HTML form
<form action="URL_VALUE" method="post" enctype="multipart/form-data">
<input type="hidden" name="key" value="VALUE" />
<input type="hidden" name="AWSAccessKeyId" value="VALUE" />
<input type="hidden" name="policy" value="VALUE" />
<input type="hidden" name="signature" value="VALUE" />
<input type="hidden" name="x-amz-meta-test-tag" value="test-tag" />
File:
<input type="file" name="file" />
<input type="submit" name="submit" value="Upload to Amazon S3" />
</form>
However, none of them seem to work. The file is uploaded to s3 successfully. I just couldn't set the meta tag