当前位置:网站首页>New formdata() when importing files
New formdata() when importing files
2022-04-23 06:50:00 【Time202051】
formData in append When you array, you have to JSON.stringify(arr) No, direct arr It becomes a string
const files = e.target.files
const formdata = new FormData();
formdata.append("file", files[0]);
// Be careful
Object.keys(obj).forEach(item=>{
formdata.append(item, JSON.stringify(arr))
})
版权声明
本文为[Time202051]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230551594176.html
边栏推荐
猜你喜欢
随机推荐
Mailbox string judgment
微信小程序之改变数组中某值,对象中某值的方法
如何使用input表单向服务发送(占用较小)图片文件(body传输)?涉及到FileReader内置对象
Your brain expands and shrinks over time — these charts show how
Redux overview
查漏补缺(七)
Overview of node file system and buffer
Analysis of fixed point PID code of FOC motor Library
freeCodeCamp----budget & category 练习
1-3 组件与模块
Promise(二)
C# Dapper 基本使用 增删改查事务等
js查找字符串中出现了三次的字符
查漏补缺(六)
1-3 NodeJS的安装之清单配置与跑项目环境
查漏补缺(五)
sqlserver性能优化建议
1-2 NodeJS的特点
查漏补缺(九)---程序篇
服务器常见错误代码 总结