commit
b049eede1f
@ -60,6 +60,7 @@
|
|||||||
|| options.formData !== false
|
|| options.formData !== false
|
||||||
&& mergedAttrs[ this.fileAttribute ]
|
&& mergedAttrs[ this.fileAttribute ]
|
||||||
&& mergedAttrs[ this.fileAttribute ] instanceof File
|
&& mergedAttrs[ this.fileAttribute ] instanceof File
|
||||||
|
|| mergedAttrs[ this.fileAttribute ] instanceof FileList
|
||||||
|| mergedAttrs[ this.fileAttribute ] instanceof Blob ) {
|
|| mergedAttrs[ this.fileAttribute ] instanceof Blob ) {
|
||||||
|
|
||||||
// Flatten Attributes reapplying File Object
|
// Flatten Attributes reapplying File Object
|
||||||
@ -71,6 +72,12 @@
|
|||||||
// Converting Attributes to Form Data
|
// Converting Attributes to Form Data
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
_.each( formAttrs, function( value, key ){
|
_.each( formAttrs, function( value, key ){
|
||||||
|
if (value instanceof FileList) {
|
||||||
|
_.each(value, function(file) {
|
||||||
|
formData.append( key, file );
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
formData.append( key, value );
|
formData.append( key, value );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user