提交 1949d3ff 编写于 作者: K kohsuke

See...

See http://www.bennadel.com/blog/1273-Setting-Form-EncType-Dynamically-To-Multipart-Form-Data-In-IE-Internet-Explorer-.htm

Quote:

A while back, I posted an AJAX-Style file upload demo. While using that technique in a current project, I discovered a bit of a bug. In FireFox, you can dynamically set the EncType of a form element to be "multipart/form-data" for file uploads; however, this does not work in Internet Explorer (IE). Apparently in IE, you have to set the "encoding" of the form rather than the "enctype". The good news is, you can set both values without concern and this will take care of the problem:

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15085 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3db54585
......@@ -1232,7 +1232,8 @@ function buildFormTree(form) {
}
}
// switch to multipart/form-data to support file submission
form.enctype = "multipart/form-data";
// @enctype is the standard, but IE needs @encoding.
form.enctype = form.encoding = "multipart/form-data";
break;
case "radio":
if(!e.checked) break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册