Search code examples
jqueryfile-uploadamazon-s3swfupload

MultiPowUpload (flash file upload component) giving Error #2049 while uploading to Amazon S3


Using MultiPowUpload (flash file upload component) to Upload files to Amazon S3.

I just use the flash_amazons3generator.html file to generate the "S3 Policy and Signature" to paste in var flashvars = {}.

But when I tried to upload it giving me "Error #2049".

Here is my S3 Policy and Signature:

 var flashvars = {
      "uploadUrl": "http://myBucket.s3.amazonaws.com",
      "amazonS3.accessKeyId": "xxxxxx",
      "amazonS3.policy": "xxxxxx",
      "amazonS3.signature": "xxxxx",
      "amazonS3.acl": "public-read-write",
      "amazonS3.key": "xxxxx"
 };

I also tried to use 'encodeURI' and 'encodeURIComponent' method, may be its a problem due to Encoding but no avail:

 'policy': encodeURI(data.policy)
 'signature': encodeURIComponent(data.signature)

Any idea where I am going wrong?.


Solution

  • I got the solution where its is going wrong. The solution is I'm missing one important thing. That I should set the content type for crossdomain.xml file to text/xml.

    The following image will help. How to set that: crossdomain.xml file to text/xml