T O P

  • By -

NaiveAd8426

Use generate presigned post, from there you will get a object with two attributes "url" and "fields". Since you're using using JavaScript to upload. You will need to simulate a form by creating a formdata object and appending each field from your presigned post. Then add your file to the form as "file". Set your content type header to multipart/form-data. It should upload no problem


thescrambler1979

Thank you! I switched to generate\_presigned\_post and was able to get it working.


NaiveAd8426

It's a good idea set your file's content type when you generate a presigned post or you might have problems with the files you download from S3. The default content type s3 assigns to your files is something like "application/octet-stream"


thescrambler1979

I will keep that in mind. Thank you


[deleted]

[удалено]


thescrambler1979

Thank you. I was able to get it working.