Uploading large objects into Amazon S3 using Multipart upload (2024)

Uploading large objects into Amazon S3 using Multipart upload (1)

Abhijith S Nair Uploading large objects into Amazon S3 using Multipart upload (2)

Abhijith S Nair

Partner Solutions Architect at Amazon Web Services

Published Jan 10, 2023

Note: This article was originally posted on abhijithnair.com.

Amazon S3 is an object-based storage service provided by AWS and depending upon the size of the uploading object, there are a few things you must know:

  1. Using Amazon S3 Console, you can upload a single object up to 160 GB in size.
  2. To upload a file larger in size than 160 GB, you may use the AWS CLI, AWS SDK or even S3 REST API. However through a single PUT operation, you can only upload a single object up to 5 GB in size.
  3. The maximum size of an individual object in S3 cannot be greater than 5 TB.

But if a single PUT operation can upload an object of size only up to 5 GB, how will you upload a larger file? This is where you would leverage Amazon S3's Multipart Upload feature. Using multipart upload, you can upload a single data object into Amazon S3 as a set of parts. Each part is a portion of the data object which can be independently uploaded in any order. Once all the parts are uploaded, Amazon S3 fetches these parts, combines & creates a single data object. This feature also allows you to resume the upload process, even if the connection breaks while uploading files. It is recommended by AWS to use the multipart upload feature if the uploading data object has a size of 100 MB or more.

What to expect?

In this blog, I will explain how to upload a video file into Amazon S3 using the S3 Multipart upload feature.

Prerequisites

In order to pursue this task, I have a video file of size 232.3 MB which currently resides on my local machine. I also have an Amazon S3 bucket my-s3-multipart-upload created in the us-east-1 region with all the default settings. I will be using AWS CloudShell to perform the following tasks.

Procedure

1.Login to AWS CloudShell and upload the video file.

Uploading large objects into Amazon S3 using Multipart upload (3)

2. Use the split command to split the original file. Here I have split them into separate contiguous 100 MB file. As you may see there are 3 parts in total: file-aa, file-ab and file-ac respectively.

Uploading large objects into Amazon S3 using Multipart upload (4)

3. Install openssl to generate MD5 checksum values for our files.

Uploading large objects into Amazon S3 using Multipart upload (5)

4. Generate MD5 checksum values for our files. Copy and save them to a clipboard.

Uploading large objects into Amazon S3 using Multipart upload (6)

5. Start the multipart upload process using the following command. Copy & save the generated UploadId to a clipboard.

aws s3api create-multipart-upload --bucket <bucket_name> --key <original_file_name> --metadata md5=<original_file_checksum_value> 
Uploading large objects into Amazon S3 using Multipart upload (7)

6. Upload each individual file parts using the following command. The upload-part command generates an ETag value for each parts.

aws s3api upload-part --bucket <bucket_name> --key <original_file_name> --part-number 1 --body <file_name_1> --upload-id <upload_id_from_step5> 
Uploading large objects into Amazon S3 using Multipart upload (8)

7. List all the file parts using the following command.

aws s3api list-parts --bucket <bucket_name> --key <original_file_name> --upload-id <upload_id_from_step5> 
Uploading large objects into Amazon S3 using Multipart upload (9)

8. Copy & save the PartNumber and ETag values for all the file parts into a JSON file. You can use the nano command to create a JSON file.

Uploading large objects into Amazon S3 using Multipart upload (10)

9. Complete the upload process using the following command.

aws s3api complete-multipart-upload --multipart-upload file://<JSON_file> --bucket <bucket_name> --key <original_file_name> --upload-id <upload_id_from_step5> 
Uploading large objects into Amazon S3 using Multipart upload (11)

10. The original file can be now fetched from the Amazon S3 bucket.

Uploading large objects into Amazon S3 using Multipart upload (12)

I hope this blog helped in explaining how to upload a large file into Amazon S3 using the S3 Multipart Upload feature. Please do check out my other blogs on this portfolio.

Until then, Happy Blogging!

To view or add a comment, sign in

Sign in

Stay updated on your professional world

Sign in

By clicking Continue to join or sign in, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.

New to LinkedIn? Join now

Explore topics

Uploading large objects into Amazon S3 using Multipart upload (2024)
Top Articles
Is the World Ready to Meet the Indian Middle Class?
How to Clean Silver and Prevent Tarnish Using Pantry Ingredients
Dainty Rascal Io
Srtc Tifton Ga
Archived Obituaries
Coffman Memorial Union | U of M Bookstores
Monticello Culver's Flavor Of The Day
Chastity Brainwash
Spelunking The Den Wow
Nj Scratch Off Remaining Prizes
How to Store Boiled Sweets
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Mail.zsthost Change Password
Moviesda3.Com
Rams vs. Lions highlights: Detroit defeats Los Angeles 26-20 in overtime thriller
Zack Fairhurst Snapchat
50 Shades Of Grey Movie 123Movies
Scotchlas Funeral Home Obituaries
Why Should We Hire You? - Professional Answers for 2024
The Blind Showtimes Near Amc Merchants Crossing 16
Rqi.1Stop
The Old Way Showtimes Near Regency Theatres Granada Hills
Jeffers Funeral Home Obituaries Greeneville Tennessee
Craigslist Maryland Trucks - By Owner
Vernon Dursley To Harry Potter Nyt Crossword
Devotion Showtimes Near Regency Buenaventura 6
Hefkervelt Blog
Free T33N Leaks
Frank Vascellaro
Gt7 Roadster Shop Rampage Engine Swap
Craigslist Texas Killeen
Rund um die SIM-Karte | ALDI TALK
Pnc Bank Routing Number Cincinnati
Matlab Kruskal Wallis
Sitting Human Silhouette Demonologist
Hattie Bartons Brownie Recipe
Nsu Occupational Therapy Prerequisites
Montrose Colorado Sheriff's Department
The Complete Guide To The Infamous "imskirby Incident"
The Thing About ‘Dateline’
Albertville Memorial Funeral Home Obituaries
The Holdovers Showtimes Near Regal Huebner Oaks
Frommer's Philadelphia &amp; the Amish Country (2007) (Frommer's Complete) - PDF Free Download
Mid America Clinical Labs Appointments
Reese Witherspoon Wiki
The Wait Odotus 2021 Watch Online Free
Dobratz Hantge Funeral Chapel Obituaries
1990 cold case: Who killed Cheryl Henry and Andy Atkinson on Lovers Lane in west Houston?
Festival Gas Rewards Log In
Craigslist.raleigh
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 5887

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.