Skip to content

Commit

Permalink
#2284 jQuery Fileupload가 safari에도 파일 업로드에 실패하는 문제 수정
Browse files Browse the repository at this point in the history
- safari에서 dialog에서 선택한 파일을 업로드할 수 없는 문제
- PR 코드로 패치 함 : blueimp/jQuery-File-Upload#3512
  • Loading branch information
bnu committed Aug 17, 2018
1 parent c8e4f01 commit ef6bfa5
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions common/js/plugins/jquery.fileupload/js/jquery.fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});
},
Expand Down Expand Up @@ -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();
}
Expand All @@ -1213,10 +1206,10 @@
return $.when.apply(
$,
$.map(fileInput, this._getSingleFileInputFiles)
).then(function () {
).then(function (files) {
return Array.prototype.concat.apply(
[],
arguments
files
);
});
},
Expand All @@ -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);
}
Expand Down

0 comments on commit ef6bfa5

Please sign in to comment.