logo
Published on

File Upload Limitation

Authors
  • avatar
    Name
    Bowen Y
    Twitter

How can I upload large files?

The limitation on the server configuration size

Let take PHP+Nginx as an example, we need to update the following parameters to increase the file upload limitations:

Nginx: 
    client_max_body_size
PHP:
    post_max_size
    upload_max_filesize
    max_file_uploads
Reference:

https://serverfault.com/questions/611239/increase-php-fpms-max-upload-post-size

Request payload limit with AWS API Gateway

Maximum payload to API gateway is 10 MB and maximum payload for Lambda is 6 MB, which cannot be increased.

Please see API gateway payload limits here

Please see Lambda payload limits here

But there is an alternative way (a work around) to achieve the same by uploading data to an S3 bucket if your size is more that 10 MB. Please read the below article for details (Unofficial document):

https://sookocheff.com/post/api/uploading-large-payloads-through-api-gateway/

Reference:

https://stackoverflow.com/questions/46358922/request-payload-limit-with-aws-api-gateway

https://aws.amazon.com/cn/blogs/compute/patterns-for-building-an-api-to-upload-files-to-amazon-s3/#:~:text=Using%20Amazon%20API%20Gateway%20as%20a%20direct%20proxy&text=This%20pattern%20allows%20you%20to,payload%20size%20of%2010%20MB.