Upload progress callback
See original GitHub issueThis would solve…
Currently there’s no way to get upload progress other than passing a stream. What if we’re passing a 10MB Buffer instead? Readable.from(buffer)
and we’re storing it twice, which is unfortunate. So for an application that handles 100MB at a time we would need 200MB.
The implementation should look like…
client.dispatch({
path: '/',
method: 'GET',
headers: {
'x-foo': 'bar'
}
}, {
...
onUploadProgress: (bytes) => {
console.log(`onUploadProgress : ${bytes} bytes in total`)
},
...
})
I have also considered…
Reading the state from the underlying socket. It’s not so nice.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
File Upload Progress bar - CodePen
HTML ; 1. <h2>HTML5 File Upload Progress Bar Tutorial</h2> ; 2. <form id="upload_form" enctype="multipart/form-data" method="post"> ; 3. <input type="file" name=" ...
Read more >File Upload Progress Bar with JS and PHP - CodeShack
In this tutorial, we'll be creating a multiple file upload interface with a progress bar using JavaScript (AJAX) and PHP.
Read more >How to Create Graphical File Upload Progress Bars in HTML5 ...
File upload progress bars provide essential user feedback but they've been notoriously difficult to implement. Until now that is. Both Firefox ...
Read more >Add upload progress callback · Issue #183 · sindresorhus/ky
I need upload progress, not download progress. And onDownloadProgress doesn't help me.
Read more >File Upload with Progress Bar HTML CSS & JavaScript
File Upload JavaScript with Progress Bar [Source Codes] · html lang="en"> · head> · meta charset="UTF-8"> · meta name="viewport" content="width= ...
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 Free
Top 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
This would be a nice feature to add! I think we should make the callback arrive to https://github.com/nodejs/undici/blob/b33dffa76d34d31a7ee189ac72c5ace5ef75e7f3/lib/client.js#L1423 and call it afterwards (if it’s present).
I’m questioning a bit the use case… I would not allocate a massive buffer in the first place.