【发布时间】:2011-09-09 14:37:51
【问题描述】:
我有一个页面,其中表单的内容类型设置为enctype="multipart/form-data"。该页面包含<input type="file" 标签和一个发布(启动上传)的按钮。两者都在通过 ajax 更新的面板内。单击该按钮会生成一个内容类型为application/x-www-form-urlencoded 的xmlhttp 请求。
基本上,当上传输入在通过 ajax 更新的容器内时,表单的 enctype 会被忽略。
有很多帖子说您不能使用 ajax 拥有 multipart/form-data。为什么是这样?
【问题讨论】:
标签: html ajax content-type xmlhttprequest