Allow AWS-S3 multipart uploads of < 5mb
Initial checklist
- I understand this is a bug report and questions should be posted in the Community Forum
- I searched issues and couldn’t find anything (or linked relevant results below)
Link to runnable example
No response
Steps to reproduce
Uppy AWS 6.1.0. Using server-side signing, write code to support all the necessary callbacks, and set shouldUseMultipart to true. Upload a file of < 5mb; instead of using multipart uploading, a PUT upload will be used.
Expected behavior
The file should be uploaded multipart, as requested.
To be clear: what happens is the current documented behaviour: "Files of 5 MiB or smaller are always uploaded in a single request, because S3 does not accept multipart uploads below its minimum part size."
However, this documentation is incorrect. I know this, because Uppy 5 was quite happy to multipart upload sub 5mb files. In a multipart upload, the final part can be below its minimum size; this is how, eg, a 6mb upload works (a 5mb part, and a 1mb part). However, all non-final parts must be above that size. The current behaviour as documented is, we believe, based on a mis-interpretation of the AWS docs (and the fact this behaviour was possibly previously is indication of this).
Actual behavior
Any < 5mb file is uploaded with a PUT, no multipart. What this means is that sub 5mb files always create an object on S3, even if they then fail to complete; by contrast, a multipart file clears up after itself if the upload fails. This is, as it stands, a regression for small-file behaviour with multipart upload.
Source: transloadit/uppy