0

Please or Register to create posts and topics.

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

@kennethsumrall

thank you but I resolve this problem.