File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1212
1313// AMD support
1414( function ( factory ) {
15+ "use strict" ;
1516 if ( typeof define === 'function' && define . amd ) {
1617 // using AMD; register as anon module
1718 define ( [ 'jquery' ] , factory ) ;
@@ -491,7 +492,10 @@ $.fn.ajaxSubmit = function(options) {
491492 // take a breath so that pending repaints get some cpu time before the upload starts
492493 function doSubmit ( ) {
493494 // make sure form attrs are set
494- var t = $form . attr2 ( 'target' ) , a = $form . attr2 ( 'action' ) ;
495+ var t = $form . attr2 ( 'target' ) ,
496+ a = $form . attr2 ( 'action' ) ,
497+ mp = 'multipart/form-data' ,
498+ et = $form . attr ( 'enctype' ) || $form . attr ( 'encoding' ) || mp ;
495499
496500 // update form attrs in IE friendly way
497501 form . setAttribute ( 'target' , id ) ;
@@ -573,6 +577,7 @@ $.fn.ajaxSubmit = function(options) {
573577 finally {
574578 // reset attrs and remove "extra" input elements
575579 form . setAttribute ( 'action' , a ) ;
580+ form . setAttribute ( 'enctype' , et ) ; // #380
576581 if ( t ) {
577582 form . setAttribute ( 'target' , t ) ;
578583 } else {
You can’t perform that action at this time.
0 commit comments