当前位置:网站首页>导入文件时候 new FormData()
导入文件时候 new FormData()
2022-04-23 05:53:00 【Time202051】
formData中append数组的时候要JSON.stringify(arr) 否者直接arr会变成字符串
const files = e.target.files
const formdata = new FormData();
formdata.append("file", files[0]);
//注意
Object.keys(obj).forEach(item=>{
formdata.append(item, JSON.stringify(arr))
})
版权声明
本文为[Time202051]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_45890414/article/details/122918550
边栏推荐
猜你喜欢
随机推荐
客户端软件增量更新
SDOI2009-HH的项链
[UDS unified diagnostic service] II. Network layer protocol (2) - data transmission rules (single frame and multi frame)
产生随机数
Figure guessing game
赛氪-zeal
[opencv] use filestorage to read and write eigenvectors
Palindromic Primes
【UDS统一诊断服务】五、诊断应用示例:Flash Bootloader
HDU-Tunnel Warfare
Introduction to nonparametric camera distortion model
copy constructor
记第一次使用阿里字体图标库
PN结、二极管原理详解与应用
Using printf in MFC
Round up a little detail of the round
[stepping on the pit] MELD in win11 wsl2 cannot be used normally. Problem repair
Sdoi2009-hh Necklace
Generate shortcut
【踩坑】Win11 WSL2 中 meld 无法正常使用问题修复








