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

- safari에서 dialog에서 선택한 파일을 업로드할 수 없는 문제
- PR 코드로 패치 함 : https://github.com/blueimp/jQuery-File-Upload/pull/3512
This commit is contained in:
bnu 2018-08-17 16:21:10 +09:00 committed by Kijin Sung
parent d9a7b89a74
commit 21acfd97cc

View file

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