debug: console.log upload progress events
This commit is contained in:
parent
5f2cb3dc64
commit
344b3b189f
1 changed files with 1 additions and 0 deletions
|
|
@ -157,6 +157,7 @@ async function handleUpload(formData) {
|
||||||
xhr.setRequestHeader('X-Session-ID', sessionId);
|
xhr.setRequestHeader('X-Session-ID', sessionId);
|
||||||
|
|
||||||
xhr.upload.addEventListener('progress', (e) => {
|
xhr.upload.addEventListener('progress', (e) => {
|
||||||
|
console.log('upload', e.loaded, e.total, e.lengthComputable);
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
const pct = Math.round((e.loaded / e.total) * 100);
|
const pct = Math.round((e.loaded / e.total) * 100);
|
||||||
const mb = (e.loaded / (1024**2)).toFixed(0);
|
const mb = (e.loaded / (1024**2)).toFixed(0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue