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 12
12
13
13
// AMD support
14
14
( function ( factory ) {
15
+ "use strict" ;
15
16
if ( typeof define === 'function' && define . amd ) {
16
17
// using AMD; register as anon module
17
18
define ( [ 'jquery' ] , factory ) ;
@@ -491,7 +492,10 @@ $.fn.ajaxSubmit = function(options) {
491
492
// take a breath so that pending repaints get some cpu time before the upload starts
492
493
function doSubmit ( ) {
493
494
// 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 ;
495
499
496
500
// update form attrs in IE friendly way
497
501
form . setAttribute ( 'target' , id ) ;
@@ -573,6 +577,7 @@ $.fn.ajaxSubmit = function(options) {
573
577
finally {
574
578
// reset attrs and remove "extra" input elements
575
579
form . setAttribute ( 'action' , a ) ;
580
+ form . setAttribute ( 'enctype' , et ) ; // #380
576
581
if ( t ) {
577
582
form . setAttribute ( 'target' , t ) ;
578
583
} else {
You can’t perform that action at this time.
0 commit comments