Revert "Revert "#2284 jQuery Fileupload가 safari에도 파일 업로드에 실패하는 문제 수정""

This reverts commit fa4fb72b27.
This commit is contained in:
Kijin Sung 2018-10-18 09:58:54 +09:00
parent 2ab012f65b
commit 9a82af7366

View file

@ -1144,10 +1144,10 @@
$.map(entries, function (entry) { $.map(entries, function (entry) {
return that._handleFileTreeEntry(entry, path); return that._handleFileTreeEntry(entry, path);
}) })
).then(function () { ).then(function (entries) {
return Array.prototype.concat.apply( return Array.prototype.concat.apply(
[], [],
arguments entries
); );
}); });
}, },
@ -1179,16 +1179,9 @@
_getSingleFileInputFiles: function (fileInput) { _getSingleFileInputFiles: function (fileInput) {
fileInput = $(fileInput); fileInput = $(fileInput);
var entries = fileInput.prop('webkitEntries') || var files = $.makeArray(fileInput.prop('files'));
fileInput.prop('entries'),
files,
value;
if (entries && entries.length) {
return this._handleFileTreeEntries(entries);
}
files = $.makeArray(fileInput.prop('files'));
if (!files.length) { if (!files.length) {
value = fileInput.prop('value'); var value = fileInput.prop('value');
if (!value) { if (!value) {
return $.Deferred().resolve([]).promise(); return $.Deferred().resolve([]).promise();
} }
@ -1213,10 +1206,10 @@
return $.when.apply( return $.when.apply(
$, $,
$.map(fileInput, this._getSingleFileInputFiles) $.map(fileInput, this._getSingleFileInputFiles)
).then(function () { ).then(function (files) {
return Array.prototype.concat.apply( return Array.prototype.concat.apply(
[], [],
arguments files
); );
}); });
}, },
@ -1228,7 +1221,7 @@
form: $(e.target.form) form: $(e.target.form)
}; };
this._getFileInputFiles(data.fileInput).always(function (files) { this._getFileInputFiles(data.fileInput).always(function (files) {
data.files = files; data.files = $.makeArray(files);
if (that.options.replaceFileInput) { if (that.options.replaceFileInput) {
that._replaceFileInput(data); that._replaceFileInput(data);
} }