Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created March 19, 2021 09:56
Show Gist options
  • Save thanakijwanavit/7dc80179c01363d5115cbd65e364d759 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/7dc80179c01363d5115cbd65e364d759 to your computer and use it in GitHub Desktop.
update to s3 using signedurl
func uploadfileAWSS3(fileuploadurl, contenttype, file): Observable<any>{
//this will be used to upload all csv files to AWS S3
const headers = new HttpHeaders({‘Content-Type’: contenttype});
const req = new HttpRequest(
‘PUT’,
fileuploadurl,
file,
{
headers: headers,
reportProgress: true, //This is required for track upload process
});
return this.http.request(req);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment