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,
|
chunkSize = options.size || 1024 * 1024,
|
||||||
chunkURL,
|
chunkURL,
|
||||||
file = options.file,
|
file = options.file,
|
||||||
|
bytesAvailable = file.size,
|
||||||
maxRetry = -1,
|
maxRetry = -1,
|
||||||
nextChunkId,
|
nextChunkId,
|
||||||
paused = false,
|
paused = false,
|
||||||
|
@ -56,6 +57,9 @@ pandora.chunkupload = function(options) {
|
||||||
response: response,
|
response: response,
|
||||||
responseText: that.responseText
|
responseText: that.responseText
|
||||||
});
|
});
|
||||||
|
options = null;
|
||||||
|
file = null;
|
||||||
|
request = null
|
||||||
}
|
}
|
||||||
|
|
||||||
function initUpload() {
|
function initUpload() {
|
||||||
|
@ -121,8 +125,7 @@ pandora.chunkupload = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadChunk(chunkId) {
|
function uploadChunk(chunkId) {
|
||||||
var bytesAvailable = file.size,
|
var chunk,
|
||||||
chunk,
|
|
||||||
chunkOffset = chunkId * chunkSize;
|
chunkOffset = chunkId * chunkSize;
|
||||||
|
|
||||||
if (aborted) {
|
if (aborted) {
|
||||||
|
|
Loading…
Reference in a new issue