Setting the Content-Type in direct to S3 upload using Rails and jQuery File Upload

后端 未结 3 1475
旧时难觅i
旧时难觅i 2020-12-16 16:16

I\'ve seen many questions here on this topic but nothing I\'ve come across has worked for me, so here I am posting another...

I\'m on Ruby on Rails trying to configu

3条回答
  •  悲哀的现实
    2020-12-16 17:12

    If anyone is looking for an updated answer to this question, I was able to solve this by:

    1. Adding a 'content type starts with' clause to my s3 presigned post, as documented on this page: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html
    2. Adding a hidden input named 'Content-Type' to my form and then updating it accordingly whenever a file is selected.

提交回复
热议问题