Reputation: 41
I am doing an API that recieves multiple files, (I read them and then upload them on S3) but i have problems with large files >5mb, only when it recives some small files works, I think it is API Gateway, that only accepts a limit size of request but even if that's right I don't know how to change those values
I am using nodejs, express, multer (multipart/form-data) and serverless for that API, I upload the files with the function putObject
Could someone help me please? Is it really API Gatewy the problem? how solve it? Or what do you think it is the problem?
thanks for the answer the error that I get with files >5mb is this
The response body is {"message": "Internal server error"}
,
headers are:
Connection → keep-alive
Content-Length → 36
Content-Type → application/json
Date → Wed, 20 Jan 2016 21:49:57 GMT
Via → 1.1 bacf4777806846760313f3a392450fc4.cloudfront.net (CloudFront)
X-Amz-Cf-Id → CjIEJj6FlzXMZO3ht4mGU94L5LMBGjWQq921ddkMUCs96NPxswGIwA==
X-Cache → Error from cloudfront
x-amzn-RequestId → bf549be8-bfbf-11e5-9a15-c9a39c4aad35
I'm gonna check the Uploading Objects Using Pre-Signed URLs i did't know them
Do you have any idea why i can't handle files >5mb?
edit
I've been looking and I saw that lambda AWS has a limit of 6 mb, I think it's another problem, if I upload the file using pre-signed URLs, will the problem be solved?
Upvotes: 4
Views: 6280
Reputation: 4482
How much files does your API receive in a second?
The Payload size
limit of an API Gateway is 10MB and cannot be increased (its a hardlimit). But if you say that it already doesnt work with files of 5MB this shouldnt be the issue...
Do you receive any kind of errors while uploading >5MB, <10MB files?
A helpful link to discover API Gateway Limits.
To answer your second question: how solve it?
An alternative would be to use Pre-Signed URLs to upload (putObject
) files to S3.
Upvotes: 3