Upload monitoring progress
See original GitHub issueIs 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:
- Created 11 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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?