|
1 | 1 | /*
|
2 |
| - * jQuery File Upload Plugin 5.19.3 |
| 2 | + * jQuery File Upload Plugin 5.19.4 |
3 | 3 | * https://github.com/blueimp/jQuery-File-Upload
|
4 | 4 | *
|
5 | 5 | * Copyright 2010, Sebastian Tschan
|
|
10 | 10 | */
|
11 | 11 |
|
12 | 12 | /*jslint nomen: true, unparam: true, regexp: true */
|
13 |
| -/*global define, window, document, Blob, FormData, location */ |
| 13 | +/*global define, window, document, File, Blob, FormData, location */ |
14 | 14 |
|
15 | 15 | (function (factory) {
|
16 | 16 | 'use strict';
|
|
209 | 209 | if (typeof options.formData === 'function') {
|
210 | 210 | return options.formData(options.form);
|
211 | 211 | }
|
212 |
| - if ($.isArray(options.formData)) { |
| 212 | + if ($.isArray(options.formData)) { |
213 | 213 | return options.formData;
|
214 | 214 | }
|
215 |
| - if (options.formData) { |
| 215 | + if (options.formData) { |
216 | 216 | formData = [];
|
217 | 217 | $.each(options.formData, function (name, value) {
|
218 | 218 | formData.push({name: name, value: value});
|
|
345 | 345 | formData.append(paramName, options.blob, file.name);
|
346 | 346 | } else {
|
347 | 347 | $.each(options.files, function (index, file) {
|
348 |
| - // File objects are also Blob instances. |
| 348 | + // Files are also Blob instances, but some browsers |
| 349 | + // (Firefox 3.6) support the File API but not Blobs. |
349 | 350 | // This check allows the tests to run with
|
350 | 351 | // dummy objects:
|
351 |
| - if (file instanceof Blob) { |
| 352 | + if ((window.Blob && file instanceof Blob) || |
| 353 | + (window.File && file instanceof File)) { |
352 | 354 | formData.append(
|
353 | 355 | options.paramName[index] || paramName,
|
354 | 356 | file,
|
|
758 | 760 | that._onSend(e, this);
|
759 | 761 | return this.jqXHR;
|
760 | 762 | };
|
761 |
| - return (result = that._trigger('add', e, newData)); |
| 763 | + result = that._trigger('add', e, newData); |
| 764 | + return result; |
762 | 765 | });
|
763 | 766 | return result;
|
764 | 767 | },
|
|
0 commit comments