var fd = new FormData();
fd.append('file', data.target.files[0]);
return this.http.post(url), fd).map().catch();
Using AngularJS it's working but for angular 4 when i used the same way it's not working.I am getting disk error while uploading excel file.Please help me.
In service
public importMassUpdateExcel(file: FormData, id): Observable<any> {
const headers = new Headers({
'Authorization': '',//authorization token
'Content-Type': 'application/json; charset=UTF-8'//
});
const options = new RequestOptions({
headers: headers
});
return this.http
.post(url, file, options)
.map()
.catch();
}