我正在尝试使用axios和php上传excel文件。 当我发布一个带有axios的文件时,我在php端获得了空的数组 我的代码
var formdata = new FormData();
var filedata = document.getElementById('file-upload').files[0];
formdata.append('paymentfile',filedata);
const result = uploadFile(formdata);
result.then(function(response){ }
//my uploadFile function is like
uploadFile(data){
const confi = {
headers: { 'content-type': 'multipart/form-data' }
}
const url = "http://localhost/codeigniter/user/uploadExcel";
return axios.post(url,data,confi);
}