
nodejs
qq_45209973
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
multer结合FormData多文件上传
tips记录一下使用multer 和 FormData 多文件上传的几个注意点和具体过程页面input 元素添加 multiple 属性创建formdata实例,将文件迭代添加到imgs字段;必须添加到同一个字段将formdata作为fetch的 body 发送;注意,不要添加任何响应头(我之前就是自作聪明添加了"Content-Type":“multipart/form-data”,一直没有成功),它会自动设置的<!DOCTYPE html><html lang="en原创 2020-07-08 19:07:24 · 617 阅读 · 0 评论 -
multer 文件上传
文件上传使用的是 express 搭建的 nodejs 服务器form 表单注意设置 enctype: multipart/form-data 属性,否则服务器将无法正确解析表单数据<form action="/api/upload" method="POST" enctype="multipart/form-data"> <p> <input type="file" name="img123" accept="image/*"> &l原创 2020-06-11 12:30:41 · 185 阅读 · 0 评论