Hi,
I want to cors upload my video file from browser to Amazon S3 storage via asp.net project. But I keep getting this error:the request signature we calculated does not match the signature you provided
Here is the javascript code I have;
function uploadFile() {
var access_key = "xx";
var secret = "xx";
var policy = "xx";
var signature = "xx";
var file = document.getElementById('file').files[0];
var fd = new FormData();
var key = "folder1/" + (new Date).getTime() + '-' + file.name;
fd.append('key', key);
fd.append('acl', 'public-read-write');
fd.append('Content-Type', file.type);
fd.append('AWSAccessKeyId', access_key);
fd.append('policy', policy)
fd.append('signature', signature);
fd.append("file", file);
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener("progress", uploadProgress, false);
xhr.addEventListener("load", uploadComplete, false);
xhr.addEventListener("error", uploadFailed, false);
xhr.addEventListener("abort", uploadCanceled, false);
xhr.open('POST', 'https://bucketName.s3.amazonaws.com/', true);
xhr.send(fd);
}
What could be the reason for the error,
I'm sure accesskey,policy and signature is right.