FormData 实现文件上传
本例在angular6框架下实现
HTML
<input type='file' id='upLoadFile'>
TS
let files = document.getElementById('upLoadFile').files[0];
const formData=new FormData();
formData.append('file',files);
let headers = new Headers();
this.http.post('/dintegrationapi/budgetItem/imp', formData,{
headers: headers
}).subscribe((result:any)=>{
if(result.is_success){
}else{
}