问题遇到的现象和发生背景
node实现图片上传multer报错MulterError: Unexpected field
问题相关代码,请勿粘贴截图
<form
id="form"
method="POST"
action="http://localhost:8888/addimg?_csrf={{ ctx.csrf | safe }}"
encType="multipart/form-data"
target="myIframe"
>
<input name="title" style={{ width: "0", border: "none" }} />
<input
style={{ width: "0" }}
id="file"
onChange={selectImg}
name="imgs"
type="file"
/>
</form>
<iframe
name="myIframe"
id="myIframe"
style={{ display: "none" }}
></iframe>
运行结果及报错内容
我的解答思路和尝试过的方法
更换过name,但是没成功