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
Lesson 2 - Basic Economic Principles of Real Property Value (The Income Approach to Value)
Rust roadmap: The best way to learn Rust in 2024
Antisis City/Antisis City Gym
Ups Dropoff Location Near Me
Boomerang Media Group: Quality Media Solutions
Collision Masters Fairbanks
Miles City Montana Craigslist
Nordstrom Rack Glendale Photos
Shaniki Hernandez Cam
Citi Card Thomas Rhett Presale
R Tiktoksweets
Shuiby aslam - ForeverMissed.com Online Memorials
Pvschools Infinite Campus
Best Food Near Detroit Airport
Craigslist Farm And Garden Cincinnati Ohio
Curtains - Cheap Ready Made Curtains - Deconovo UK
Edicts Of The Prime Designate
Keurig Refillable Pods Walmart
Mikayla Campinos Laek: The Rising Star Of Social Media
China’s UberEats - Meituan Dianping, Abandons Bike Sharing And Ride Hailing - Digital Crew
Evil Dead Rise - Everything You Need To Know
Teacup Yorkie For Sale Up To $400 In South Carolina
Bible Gateway passage: Revelation 3 - New Living Translation
Https Paperlesspay Talx Com Boydgaming
Gina Wilson All Things Algebra Unit 2 Homework 8
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Gazette Obituary Colorado Springs
Kirsten Hatfield Crime Junkie
Masterbuilt Gravity Fan Not Working
Gillette Craigslist
Hrconnect Kp Login
Evil Dead Rise - Everything You Need To Know
Red Sox Starting Pitcher Tonight
Mrstryst
Gr86 Forums
Baldur's Gate 3 Dislocated Shoulder
Mta Bus Forums
Wisconsin Women's Volleyball Team Leaked Pictures
Infinite Campus Parent Portal Hall County
craigslist: modesto jobs, apartments, for sale, services, community, and events
Low Tide In Twilight Manga Chapter 53
Linkbuilding uitbesteden
Free Crossword Puzzles | BestCrosswords.com
RubberDucks Front Office
Petfinder Quiz
Abigail Cordova Murder
Missed Connections Dayton Ohio
A Snowy Day In Oakland Showtimes Near Maya Pittsburg Cinemas
Public Broadcasting Service Clg Wiki
Sunset On November 5 2023
Dr Seuss Star Bellied Sneetches Pdf
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.