We were recently trying to upload a large zip file from flutter browser app and we discovered that when we try to upload files larger than 500 MB it was throwing Buffer Allocation error. We needed to upload files larger than 10 GB.
So we started exploring other options. We finally solved the problem using S3 Multipart upload. We did not want to expose S3 credentials to client due to security reasons. So we implemented 3 APIs on server:
- InitiateMultipartUpload - This API initiates multipart upload on S3 and return uploadId to client
- UploadPart - This API receives a part from client and sends it to S3 and returns PartETag to client
- ComplateMultipartUpload - This API completes multipart upload in S3 using PartETags received from client.
After these changes I was able to upload 5GB file to S3 in 20 minutes without getting buffer allocation error.
No comments:
Post a Comment