我正在使用reactjs并在表单中发送与之关联的图像和数据。
$stmt->lastInsertId();
现在在服务器端
$stmt->execute();
我认为发送文件的方式是个问题,但我无法找到来自客户端axios的请求结构。欢迎提出建议和建议
错误:意外令牌
<form>
<input type='file' name='image'/>
</form>
let formdata = new formData();
formdata.append('file',file);
formdata.append(data,data);
let output = axios({
methodname=post,
path = '/image',
header = {
auth : token,
content-type: multipart/form-data
},
data : formdata
})
formdata = { file: (file)
data:{
title:'',
desc:''
}
}