1

I need to upload large files into S3 using AWS SDK. I see the upload API https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property does exactly that but the issue is with setting the body. I need to read the whole file upfront and that may not be possible for huge file due to memory constraints

Is there a better way of doing it without reading the file locally?

1 Answer 1

3

It is possible to upload files in chunks rather than a single upload. In fact, AWS recommend using Multipart Upload when uploading files that are bigger than 100 MB.

Multipart upload allows you to upload a single object as a set of parts. If transmission of any part fails, you can re-transmit that part without affecting other parts. After all parts of your object are uploaded, Amazon S3 assembles these parts and creates the object.

Follow this official link on AWS to learn more about uploading using multipart:

http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.