Skip to content

Commit 5344eee

Browse files
committed
Workaround for Chrome bug #149735. Fixes blueimp#1679.
Thanks to Michael hurni (pyrou) for the report and fix.
1 parent 668886f commit 5344eee

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

js/jquery.fileupload.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.17.3
2+
* jQuery File Upload Plugin 5.17.4
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -803,7 +803,11 @@
803803
},
804804
dirReader;
805805
path = path || '';
806-
if (entry.isFile) {
806+
if (entry._file) {
807+
// Workaround for Chrome bug #149735
808+
entry._file.relativePath = path;
809+
dfd.resolve(entry._file);
810+
} else if (entry.isFile) {
807811
entry.file(function (file) {
808812
file.relativePath = path;
809813
dfd.resolve(file);
@@ -848,8 +852,12 @@
848852
items[0].getAsEntry)) {
849853
return this._handleFileTreeEntries(
850854
$.map(items, function (item) {
855+
var entry;
851856
if (item.webkitGetAsEntry) {
852-
return item.webkitGetAsEntry();
857+
entry = item.webkitGetAsEntry();
858+
// Workaround for Chrome bug #149735:
859+
entry._file = item.getAsFile();
860+
return entry;
853861
}
854862
return item.getAsEntry();
855863
})

0 commit comments

Comments
 (0)