AWS,  S3

S3 Multipart Upload – 5 MB Part Size Limit

It is a well known limitation that Amazon S3 multipart upload requires the part size to be between 5 MB and 5 GB with an exception that the last part can be less than 5 MB.

Does it mean that you cannot upload a single small file (< 5 MB) to S3 using the multipart upload?

In practice, you can upload files of any sizes using the multipart upload. But for small files, you have to use only 1 part. In this case the first part is also the last part, so all restrictions are met.

Below is a sample S3 access log records showing that a 13 KB file was successfully uploaded:

request_datetime       operation            request_uri                           object_size
--------------------   -----------------    ---------------------                 -----------	
26/May/2020:17:02:08   REST.POST.UPLOADS    POST /file?uploads                    -
26/May/2020:17:02:08   REST.PUT.PART        PUT /file?uploadId=...&partNumber=1	  13177
26/May/2020:17:02:08   REST.POST.UPLOAD     POST /file?uploadId=...               13177 

Why to use the multipart upload for small files? Sometimes you do not know in advance the size of data you are going to upload to S3. So you can initiate a multipart upload and upload chunks concurrently when they are ready. If the data set is small you will just upload the single part, and you do not need to handle small files in a different way.