It is mentioned in this very related question (Upload directly to Amazon S3 using Plupload HTML5 runtime) that amazon now allows CORS uploads using HTML5, but has anyone successfully configured plupload to push files to s3 using the 'html5' runtime? Responses to the related question do not offer any implementation details.
Here is my current plupload configuration:
$("#uploader").plupload({
// General settings
runtimes: 'html5,flash',
url: 'http://s3.amazonaws.com/' + $('#Bucket').val(),
max_file_size: '20mb',
multipart: true,
multipart_params: {
'key': '${filename}', // use filename as a key
'Filename': '${filename}', // adding this to keep consistency across the runtimes
'acl': $('#Acl').val(),
'Content-Type': 'binary/octet-stream',
'success_action_status': '201',
'AWSAccessKeyId': $('#AWSAccessKeyId').val(),
'policy': $('#Policy').val(),
'signature': $('#Signature').val()
},
file_data_name: 'file',
multiple_queues: true,
filters: [
{ title: "Image files", extensions: "jpg,png,gif,jpeg" }
],
flash_swf_url: '/Scripts/plupload/plupload.flash.swf',
});
The above code is working for the 'flash' runtime, so the policy is generated and signed correctly.
Am I missing any arguments in the multipart_params configuration object?
Also, I am using the following CORS configuration on my s3 bucket:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Do I need to make any other configuration changes to the s3 bucket to allow CORS uploads from the 'html5' plupload runtime?