Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload Directly to amazon S3 using AJAX
    primarykey
    data
    text
    <p>I'm trying to upload files from browser to s3 amazon, I've modified the CORS policy rules to allow the post for the bucket, but I'm getting the error</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Error&gt;&lt;Code&gt;InvalidArgument&lt;/Code&gt;&lt;Message&gt;Bucket POST must contain a field named 'key'. If it is specified, please check the order of the fields.&lt;/Message&gt; &lt;ArgumentValue&gt;&lt;/ArgumentValue&gt;&lt;ArgumentName&gt;key&lt;/ArgumentName&gt;&lt;RequestId&gt;1E0A8DC78C0CEA9A&lt;/RequestId&gt;&lt;HostId&gt;XN38Qje9hUrGqHNIhtT8CtowX9tXlpyfEoaXb1UNxlsyLOWreh2mKqKVXg1zjLVl&lt;/HostId&gt;&lt;/Error&gt; </code></pre> <p>Here is my request and response, I'm passing key parameter in the right order by still getting this error</p> <p><img src="https://i.stack.imgur.com/YJfCz.png" alt="http://screencast.com/t/9ZUQO0s9d"></p> <p><img src="https://i.stack.imgur.com/zhfee.png" alt="http://screencast.com/t/CL8MKq6l6"></p> <p>Can anyone tell me whats wrong with it, I'm submitting request using FormData</p> <p>any help would be greatly appreciated.</p> <p>Thanks</p> <p>Edit: here is the code pls check </p> <pre><code>var form_data = new FormData(); form_data.append('file',hdlr.file); //form_data.append('crop_type',settings.get_cropped_type()); //form_data.append('attributes',JSON.stringify(file_attr)); $('input:hidden',$form).each(function(){ form_data.append(this.name,this.value); }); //finally post the file through AJAX var xhr = new XMLHttpRequest(); xhr.open("POST", $form[0].action, true); xhr.send(form_data); </code></pre> <p><img src="https://i.stack.imgur.com/Jpm86.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload