I’m planning to change my age old file upload routing to S3 using their new CORS upload api. But even before I’ve started, I’ve hit a roadblock. I can easily enough generate signed urls with auto expire and send it back to my client side script to start the upload. But how do I now limit the file sizes? I can’t just add the restriction in my scripts. Is there a way to configure the file size while generating that signed URL? I use BOTO on python for the signing.
Share
It looks like you can include a signed policy (including a
content-length-rangevalue) as part of files uploaded via POST. Do either of these links help?Uploading Image to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP)
http://www.tweetegy.com/2012/01/save-an-image-file-directly-to-s3-from-a-web-browser-using-html5-and-backbone-js/
(This one doesn’t actually include content-length-range in the policy, but you can add it.)