IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Ingo
Ingo@ingo
101 Posts
#1 · April 30, 2018, 5:37 pm
Quote from Ingo on April 30, 2018, 5:37 pmHi,
I try to transfer a file to the server as follows.
Client:uploadProgram(formData: FormData) { const req = new HttpRequest('POST', this.uploadUrl ,formData, { reportProgress: true, }); this.http.request(req).subscribe(event => { if (event.type === HttpEventType.UploadProgress) this.onUploadProgram.next(Math.round(100 * event.loaded / event.total)); }); }When I extend the call to Request Headers I get an error.
const req = new HttpRequest('POST', this.uploadUrl ,formData, { reportProgress: true, headers: this.getRequestHeaders() });In addition I did not find anything as I can give an error message, if the server BadRequest returns there.
Regards Ingo
Hi,
I try to transfer a file to the server as follows.
Client:
uploadProgram(formData: FormData) { const req = new HttpRequest('POST', this.uploadUrl ,formData, { reportProgress: true, }); this.http.request(req).subscribe(event => { if (event.type === HttpEventType.UploadProgress) this.onUploadProgram.next(Math.round(100 * event.loaded / event.total)); }); }
When I extend the call to Request Headers I get an error.
const req = new HttpRequest('POST', this.uploadUrl ,formData, { reportProgress: true, headers: this.getRequestHeaders() });
In addition I did not find anything as I can give an error message, if the server BadRequest returns there.
Regards Ingo
Click for thumbs down.0Click for thumbs up.0
Last edited on April 30, 2018, 5:38 pm by Ingo
IMPORTANT!
This forum is now archived. Click here for the New Support Forum