question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload monitoring progress

See original GitHub issue

Is there a way to listen the upload progress event just like AJAX does?

Example in Using_XMLHttpRequest

var req = new XMLHttpRequest();
req.addEventListener("progress", updateProgress, false);
// progress on transfers from the server to the client (downloads)
function updateProgress(evt) {
  if (evt.lengthComputable) {
    var percentComplete = evt.loaded / evt.total;
    ...
  } else {
    // Unable to compute progress information since the total size is unknown
  }
}

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexindigocommented, Jan 27, 2014

@miukki It took me some time to understand what you were trying to do. I hope I got it right. 😃 Here is example of progress tracker when FormData used with Request: https://github.com/felixge/node-form-data/pull/56/files#diff-3b8080b944f5c64eb2514fe942b7c60fR60

Let me know if it works for you.

1reaction
miukkicommented, Dec 20, 2013

i try to listen for uploading data events via request.post interface (npm request) but it doest work. example code

var form = new FormData(); var uploadFile = fs.createReadStream($scope.data.pathFile); var r = request.post({uri: url, jar: false, headers: {‘X-To-Access-Token’: token}}, function (error, response, body){ // response when uploading is done })

form = r.form(); form.append(‘file’, uploadFile);
form.getLength(function(err, len) { r.setHeader(‘Content-Length’, len); });

r.on(‘data’, function (data) { // have nothing here })

uploadFile.on(‘data’, function (chunk) { //its event for read data, not for uploading })

what i did wrong?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uploading files with progress monitoring in VanillaJS, Angular ...
So, in this post we will see how to upload files asynchronously with JavaScript with progress monitoring. Step 1: Our backend. Yes, we...
Read more >
Session Upload Progress - Manual - PHP
When the session.upload_progress.enabled INI option is enabled, PHP will be able to track the upload progress of individual files being uploaded.
Read more >
Monitoring the Progress of an Upload - VMware
To monitor the progress of an upload, you can watch the bytesTransferred attribute of the file. Each File element in the template includes...
Read more >
Monitoring upload and download status - mail.com Help Center
If you started an upload or download for multiple items, you can monitor the progress, cancel the process or restart it. ... Monitor...
Read more >
How do I monitor the progress of a file upload to a servlet?
This tutorial describes how to monitor the progress of a file upload to a servlet.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found