From 1949d3ffe8f2b8360b2a828e3609eba656741828 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 6 Feb 2009 21:54:48 +0000 Subject: [PATCH] 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 --- war/resources/scripts/hudson-behavior.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js index 07ae224717..4fff395361 100644 --- a/war/resources/scripts/hudson-behavior.js +++ b/war/resources/scripts/hudson-behavior.js @@ -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; -- GitLab