forked from 0x2620/pandora
file.size is expensive
This commit is contained in:
parent
3ce0fbfb81
commit
05b9e0b942
1 changed files with 5 additions and 2 deletions
|
@ -30,6 +30,7 @@ pandora.chunkupload = function(options) {
|
|||
chunkSize = options.size || 1024 * 1024,
|
||||
chunkURL,
|
||||
file = options.file,
|
||||
bytesAvailable = file.size,
|
||||
maxRetry = -1,
|
||||
nextChunkId,
|
||||
paused = false,
|
||||
|
@ -56,6 +57,9 @@ pandora.chunkupload = function(options) {
|
|||
response: response,
|
||||
responseText: that.responseText
|
||||
});
|
||||
options = null;
|
||||
file = null;
|
||||
request = null
|
||||
}
|
||||
|
||||
function initUpload() {
|
||||
|
@ -121,8 +125,7 @@ pandora.chunkupload = function(options) {
|
|||
}
|
||||
|
||||
function uploadChunk(chunkId) {
|
||||
var bytesAvailable = file.size,
|
||||
chunk,
|
||||
var chunk,
|
||||
chunkOffset = chunkId * chunkSize;
|
||||
|
||||
if (aborted) {
|
||||
|
|
Loading…
Reference in a new issue