Amazon S3 – Your proposed upload is smaller than the minimum allowed size

Question:

I’m having problems when I want to upload an image to my amazon s3 bucket.

I’m trying to upload a jpg image with the size of 238 KB. I’ve put a try/catch in my code to check what the error was. I always get this error:

Your proposed upload is smaller than the minimum allowed size

I’ve also tried this with images from 1MB and 2MB, same error … .

Here’s my code:

(I’ve changed the bucket, keys and image link.)
Has anyone had this before? Searching on the internet didn’t help me much.
Also searching to change the minimum upload size didn’t provide much help.

UPDATE:
When I tried this with a local image (changed the filename), it worked! How can I make this work with an image that’s online? Now I save it in my temp file and then upload it from there. But isn’t there a way to store it directly without saving it locally?

Answer:

The minimal multipart upload size is 5Mb (1), even if your total size is 100MB, each individual multipart upload (other than the last one) can’t be smaller than 5MB. You probably want to use a “normal” upload, not a multipart upload.

(1) http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPart.html

Leave a Reply