I have tried to send file using HttpClient:
public async uploadProfile(data: UploadProfile): Promise<any> {
return await this.http.post(this.uploadProfileUrl, data).toPromise();
}
Before sending file I prepare it to binary array:
interface UploadProfile {
file: any;
}
file = [123, 10, 32, 32, 34, 100, 105, 115, 97, 98, 108, 101, 83, 105, 122, 101, 76, 105, 109]
But I get error:
TypeError: Cannot read property 'toLowerCase' of undefined
at HttpXsrfInterceptor.intercept (http.js:2177)
this.uploadProfileUrl