[英]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 我在python3上使用aws lambda函数,并尝试在s3上上传> 1mb图像,但无法上传,问题是aws lambda不支持分段上传,所以我从json作为base64进行上传,但是当图像很大时,它们的base64也是大,它超过了AWS Lambda函数的原始输入限制,但实际上我只能上传70 kb的图像,无非是有人可以指导我该怎么做
I have already tried base64 but it gives issue in larger size than 70kb of image 我已经尝试过base64,但是它会产生大于70kb图片的问题
Take a look here: https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/ 在这里看看: 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. 请记住,API网关的请求大小限制为10 MB。 AWS Lambda has a request size limit of 6 MB.
AWS Lambda的请求大小限制为6 MB。
When you base64 encode an image it is roughly 33% bigger than the original object. 当您对图像进行base64编码时,它大约比原始对象大33%。
AWS claims the request size limit is 6MB but I have found that often times it is closer to 4MB. AWS声称请求大小限制为6MB,但我发现通常它接近4MB。
I think what you'll want to do is use a pre-signed url to bypass lambda all together. 我认为您想要做的是使用预签名的网址一起绕过lambda。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.