first time i am using AWS and s3 i have to integrate it with salesforce for uploading large files when i try to upload a file it is giving me error
OPTIONS https://s3.amazonaws.com/ritesh 403 (Forbidden) resumable.js:344
XMLHttpRequest cannot load https://s3.amazonaws.com/ritesh. Origin https://c.ap1.visual.force.com is not allowed by Access-Control-Allow-Origin.
i am using resumable.js(a javascript library for sending big files in chunk) as you can see i am sending file from url https://c.ap1.visual.force.com then i tried to send it
the code segment from where i am sending file is
var r = new Resumable({
target:'https://s3.amazonaws.com/ritesh',
chunkSize:1*1024*1024,
simultaneousUploads:4,
testChunks:false,
throttleProgressCallbacks:1,
query:{ 'key': 'Hello10' ,'AWSAccessKeyId': '*********' ,'policy':'{!$RemoteAction.S3FormController.getPolicy1}' ,'signature':'{!$RemoteAction.S3FormController.getSignedPolicy1}', 'acl': '{!AWS_S3_Object__c.Access__c}','success_action_status':'201' , 'success_action_redirect':'https://'+'{!$RemoteAction.S3FormController.getServerURL1}'+'/'+'{!AWS_S3_Object__c.id}' ,'Content-Type' :'application/zip' }
});
because i am using an existing JS library thats why its looking little weired.this code means i am sending a post request to https://s3.amazonaws.com/ritesh ritesh is my bucket name setting other post parameters like key ,AWSAccessKeyId,policy,signature,acl,success_action_status etc all parameters are praobably correct why i am getting this error.my Cors Configuration is
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://c.ap1.visual.force.com/</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>
i am sending only parameters not any header should i have to send additional headers which headers please menton!!please please help how to remove this error