|
|
@ -65,7 +65,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function uploadFile(upload_id, nuri, file, success) { |
|
|
|
function uploadFile(upload_id, nuri, file, success) { |
|
|
|
console.log(nuri); |
|
|
|
//console.log(nuri); |
|
|
|
let chunkSize = 1_048_564; |
|
|
|
let chunkSize = 1_048_564; |
|
|
|
let fileSize = file.size; |
|
|
|
let fileSize = file.size; |
|
|
|
let offset = 0; |
|
|
|
let offset = 0; |
|
|
@ -95,6 +95,7 @@ |
|
|
|
// if (onChunkError) { |
|
|
|
// if (onChunkError) { |
|
|
|
// onChunkError(event.target.error); |
|
|
|
// onChunkError(event.target.error); |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
upload_progress = { total: fileSize, current: fileSize, error: true }; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -110,15 +111,12 @@ |
|
|
|
//console.log("end upload res", res); |
|
|
|
//console.log("end upload res", res); |
|
|
|
if (success) { |
|
|
|
if (success) { |
|
|
|
upload_progress = { total: fileSize, current: fileSize }; |
|
|
|
upload_progress = { total: fileSize, current: fileSize }; |
|
|
|
success(res); |
|
|
|
await success(res); |
|
|
|
} else { |
|
|
|
|
|
|
|
upload_progress = { total: fileSize, current: fileSize, error: true }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make progress bar disappear |
|
|
|
// Make progress bar disappear |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
upload_progress = null; |
|
|
|
upload_progress = null; |
|
|
|
}, 1_000); |
|
|
|
}, 1_000); |
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|