We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I cannot get the upload progress event to work.
Here's my code:
var xhr = new XMLHttpRequest(); xhr.open('PUT', '/asset/1', true); xhr.addEventListener("load", () => { console.log("done"); }); xhr.upload.addEventListener("progress", (e) => { console.log("upload progress"); }); xhr.addEventListener("progress", (e) => { console.log("main progress"); }); xhr.send(data);
I get the following result:
PUT ................ main progress done
If I inspect the e variable on the main progress listener (it is only called ONCE), it is always the same; important parts below:
e
isTrusted: false, lengthComputable: false, loaded: 68, total: 68
Don't ask me why it's always 68 regardless of file size. I also tried xhr.upload.onProgress() and xhr.upload.on("progress", ...).
xhr.upload.onProgress()
xhr.upload.on("progress", ...)
Just a side note: the progress was working perfectly before implementing xdomain; I was using xhr.upload.onProgress().
Any ideas?
The text was updated successfully, but these errors were encountered:
Ok, figured out the "main progress" event: it is the download of data after upload. The server response is always 68 bytes in my case.
Upload events however are not called.
Sorry, something went wrong.
No branches or pull requests
I cannot get the upload progress event to work.
Here's my code:
I get the following result:
If I inspect the
e
variable on the main progress listener (it is only called ONCE), it is always the same; important parts below:Don't ask me why it's always 68 regardless of file size. I also tried
xhr.upload.onProgress()
andxhr.upload.on("progress", ...)
.Just a side note: the progress was working perfectly before implementing xdomain; I was using
xhr.upload.onProgress()
.Any ideas?
The text was updated successfully, but these errors were encountered: