简体   繁体   中英

how can i upload large image of around greater than 2 mb on S3 with aws lambda function with python

I am using aws lambda function with python3 and trying to upload > 1mb image on s3 but unable to upload it the problem is aws lambda doesn't support multipart upload so i am uploading as base64 from json but when image is big their base64 is also big and it crosses the raw input limit of aws lambda function but in actual i can only able to upload 70 kb image nothing more than that can someone guide me how can i do that

I have already tried base64 but it gives issue in larger size than 70kb of image

Take a look here: https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/

Keep in mind that API Gateway has a request size limit of 10 MB. AWS Lambda has a request size limit of 6 MB.

When you base64 encode an image it is roughly 33% bigger than the original object.

AWS claims the request size limit is 6MB but I have found that often times it is closer to 4MB.

I think what you'll want to do is use a pre-signed url to bypass lambda all together.

Multi-part presigned url with boto3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM