Skip to content

Instantly share code, notes, and snippets.

@senoritadeveloper01
Created April 24, 2022 17:13
Show Gist options
  • Save senoritadeveloper01/f23323536483de94cdfdfa72104d0e15 to your computer and use it in GitHub Desktop.
Save senoritadeveloper01/f23323536483de94cdfdfa72104d0e15 to your computer and use it in GitHub Desktop.
File Upload Process Http Parameters (Angular)
uploadFile(fileInfo: any): Observable<any> {
const headers: HttpHeaders = new HttpHeaders({
'Accept': 'application/json',
'Content-Type': fileInfo.file.type,
'X-Meta-Strategy': '1',
'X-File-Size-Sig': fileInfo.signature
});
return this.http.put(fileInfo.url, fileInfo.file, {
headers: headers,
reportProgress: true,
observe: 'events'
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment