New issue
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
onUploadProgress & onDownloadProgress for node #1793
Comments
I wrote an adapter for axios to provide uniform behavior for these handlers among other things. You may benefit from seeing the code for it: https://github.com/Azure/ms-rest-js/blob/3c131b37/lib/axiosHttpClient.ts#L103 BTW, your code may work better with fs.createReadStream as you won't have to wait for the file to be completely read before starting to upload it. |
Thanks @RikkiGibson ! Although I'm trying the code and it feels like the |
That's right. It's not perfectly accurate, but convenient to implement. I think the discrepancy between the amount of file content read and the amount of content received so far by the server will be at most the In case you find it interesting, node.js has built in backpressure mechanisms to prevent the system from running out of memory e.g. when the disk is faster than the network on a large upload, or the network is faster than the disk on a large download. |
Ah got it. Still in my case the differences is seems to be bigger than 16KB. I guess there isn't an easy solution for this. |
@chinesedfan any advance on this ? |
Please check if this has been fixed with #3694 |
Hi @jasonsaayman , I've checked and the problem still occurs. |
It would be useful to have the feature of
onUploadProgress
andonDownloadProgress
also in NodeJS.Example:
The text was updated successfully, but these errors were encountered: