Amazon S3 Multipart Uploads

Sample code for Amazon S3 multipart uploads has been added to the SprightlySoft AWS Component for .NET.  Multipart uploads is a new feature in S3 that allows you to upload a file in parts.  When all the parts have been uploaded you tell S3 to reassemble all the parts into the original file.  Some of the benefits of multipart uploads are:

  • Ability to resume an upload.  Previously if an upload failed you needed to restart the upload from the beginning.  If you uploaded 800 MB of a 900 MB file and your Internet connection was interrupted, you need to re-upload the entire file again.  With multipart uploads you upload the file in 5 MB chunks.  When a chunk is complete it sits on S3 until you are ready to complete the upload.  If your Internet connection goes down while you are uploading only the current chunk you are working on is lost.  You resume uploading from the last complete chunk on S3.
  • Concurrent uploads.  With multipart uploads you can have multiple threads uploading different parts of the same file to S3 at the same time.  You may see increased transfer speed when uploading this ways and quicker speed mean a faster upload.
  • Large object support.  Amazon S3 recently increased the maximum size of a file on S3 from 5 GB to 5 TB.  5 GB may seem like a lot but there are cases where people need to store larger files.  For example a Blu-ray movie may be 50 GB and a 2-hour uncompressed 1080p HD video is around 1.5 terabytes.  Before large object support you would need to break large files into smaller parts before sending them to S3 and reassemble them after you download the parts from S3. 

You can find the multipart uploads examples in the S3AllOperations project with the SprightlySoft AWS Component for .NET.  There is sample code in C# and VB.NET.  The component is free so give it a try.