I’ve tried using signed URL from s3 and send base64encoded image But in my s3 bucket, I am only seeing a file called mykey. SignedUrl came back successful. Any suggestion on what I am doing wrong?
const file = this.fileInput.nativeElement.files[0];
if (file) {
const reader = new FileReader();
reader.readAsDataURL(this.fileInput.nativeElement.files[0]);
reader.onload = () => {
this.fileDataUri = reader.result;
}
}
// get only the base64 file
if (this.fileDataUri.length > 0) {
const base64File = this.fileDataUri.split(',')[1];
this.store.dispatch(new fromPropertyAction.GetUserSession(base64File));
console.log(base64File);
}
}
In my action, I dispatch this API call:
const data = {'image': base64File};
this.httpClient.put(signedUrl, data)