How to upload assets to AWS presignedurl from ClientSide javascrript
How to upload assets to AWS presignedurl from ClientSide javascrript
I am approching presignedUrl method to upload a large file .
I call an API from my angular code to server side which gives me presignedUrl , then I need to upload an URL .
I have some question on this
1) Is there need to AWS SDK on my Angular side ?
I assume I dont need it , I just sent PUT request to unsigned URL and file
uploadfileAWSS3old(e,f){
const formData = new FormData();
formData.append("data",JSON.stringify({name:"testname"}));
formData.append("file", f.files[0]);
let contentType = f.files["0"].type;
const headers = new HttpHeaders(
{
'Content-Type': contentType
});
const req = new HttpRequest('PUT',this.URL,formData,
{
headers: headers,
reportProgress: true, //This is required for track upload process
});
console.log(req)
this.http.request(req)
.subscribe(event=>{
console.log(event)
})
}
But getting error of
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
SignatureDoesNotMatch
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.