What is the maximum file upload Size in Java when uploading to AWS S3?

Viewed 515

I'm trying to upload a file to s3. But the issue is that I don't know the exact size of the file, the ZIP file can be 1GB or 500MB large.

Also, if I upload the file it will be in Tomcat/temp location as temp file and I will unzip that file before uploading it to AWS S3 using core Java.

What is the recommended file size for our file in the Tomcat/temp location in the AWS EC2 instance and will it create any problem when uploading to AWS S3?

1 Answers

If you are using the AWS SDK for Java, then the maximum is 5 TB per object (in an HTTP PUT request).

"Individual Amazon S3 objects can range in size from a minimum of 0 bytes to a maximum of 5 terabytes."

Reference: https://aws.amazon.com/s3/faqs/

Example Java code with AWS SDK: https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html

Furthermore, the maximum file upload size to AWS S3 is 160 GB if you are not using AWS CLI or AWS SDK.

"You can upload any file type—images, backups, data, movies, etc.—into an S3 bucket. The maximum size of a file that you can upload by using the Amazon S3 console is 160 GB. To upload a file larger than 160 GB, use the AWS CLI, AWS SDK, or Amazon S3 REST API."

Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html

Related