boto3 lib of python, s3 image upload using presigned url with content type
See original GitHub issues3_con = boto3.client(
's3',aws_access_key_id='xxxxx', aws_secret_access_key='xxxxx',
config=Config(signature_version='s3v4'), region_name=AWS_SETUP['S3']['region']
)
url = s3_con.generate_presigned_url(
'put_object', Params={
'Bucket':AWS_SETUP['S3']['bucket_name'],
'Key':key,'ContentType':'image/jpg'
},
ExpiresIn=AWS_SETUP['S3']['expiresInsecs'],
HttpMethod='PUT'
)
print(url)
Above code is my python code which generating signed url but when I am trying to upload image using signed url I am getting error message from AWS
SignatureDoesNotMatch
If I will remove ContentType from above code, I am able to upload image but content type is set as application/x-www-form-urlencoded; charset=UTF-8
.
I have to set content type as image/jpg or image/png because while accessing, I have to send it to the third party application who needs content type to be set properly.
I am very new to AWS section integration.
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (3 by maintainers)
Top Results From Across the Web
Presigned URLs — Boto3 Docs 1.26.33 documentation - AWS
A presigned URL is generated by an AWS user who has access to the object. The generated URL is then given to the...
Read more >AWS S3 Presigned URL Upload Tutorial in Python
Step 1 – Generate the Presigned URL We can do this in python using the boto3 library to request a url from Amazon...
Read more >python AWS boto3 create presigned url for file upload
I want to use presigned urls, so the django server will sign a url and pass it back to the client, who will...
Read more >Generating a presigned URL to upload an object
A presigned URL gives you access to the object identified in the URL, provided that the creator of the presigned URL has permissions...
Read more >boto3 lib of python, s3 image upload using ... - Bountysource
boto3 lib of python, s3 image upload using presigned url with content type.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dino-cell https://github.com/boto/boto3/issues/1149#issuecomment-419463129 Try adding endpoint_url to client: