Skip to content

Commit

Permalink
Update resumable.js
Browse files Browse the repository at this point in the history
Fixed relative paths submitting incorrectly ref 23#304
  • Loading branch information
nickdatum committed May 10, 2016
1 parent 9c59976 commit ad7bea1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion resumable.js
Expand Up @@ -34,6 +34,7 @@
// PROPERTIES
var $ = this;
$.files = [];
$.paths = [];
$.defaults = {
chunkSize:1*1024*1024,
forceChunkSize:false,
Expand Down Expand Up @@ -280,6 +281,8 @@
updateQueueTotal(-1, queue);
}
else if (entry.isFile) {
//build paths array, to retrieve later
$.paths.push(entry.fullPath);
//this is handling to read an entry object representing a file, parsing the file object is asynchronous which is why we need the queue
//currently entry objects will only exist in this flow for Chrome
entry.file(function(file) {
Expand Down Expand Up @@ -400,14 +403,17 @@
function addFile(uniqueIdentifier){
if (!$.getFromUniqueIdentifier(uniqueIdentifier)) {(function(){
file.uniqueIdentifier = uniqueIdentifier;
file.sendPath = $.paths[pathIndex];
var f = new ResumableFile($, file, uniqueIdentifier);
$.files.push(f);
files.push(f);
f.container = (typeof event != 'undefined' ? event.srcElement : null);
window.setTimeout(function(){
$.fire('fileAdded', f, event)
},0);
})()};
})()} else {
$.paths.splice(pathIndex, 1);
};
}
// directories have size == 0
var uniqueIdentifier = $h.generateUniqueIdentifier(file)
Expand Down Expand Up @@ -992,6 +998,9 @@
if($.files[i] === file) {
$.files.splice(i, 1);
}
if($.paths[i]) {
$.paths.splice(i, 1);
}
}
};
$.getFromUniqueIdentifier = function(uniqueIdentifier){
Expand Down

0 comments on commit ad7bea1

Please sign in to comment.