Accessing download progress while downloading
See original GitHub issueHi I am trying to access the download progress while downloading a file through the code below. However it doesn’t show me the progress while downloading, it just shows it before starting (0) and after finishing (1). How can I access the progress while downloading?
const callback = downloadProgress => {
const progress =
downloadProgress.totalBytesWritten /
downloadProgress.totalBytesExpectedToWrite;
console.log(progress);
setProgress(progress);
};
const downloadFile = async (endpoint, fileName) => {
const downloadResumable = FileSystem.createDownloadResumable(
endpoint,
FileSystem.documentDirectory + fileName,
{},
callback
);
try {
const { uri } = await downloadResumable.downloadAsync();
setLoadingState("Done");
console.log("Finished downloading ", uri);
} catch (e) {
console.error(e);
}
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Tracking Download Progress with ... - Medium
Accessing downloaded data We'll be adding a function readDownloadedData which reads the downloaded resource as raw data and returns it. The ...
Read more >Fetch: Download progress - The Modern JavaScript Tutorial
The fetch method allows to track download progress. Please note: there's currently no way for fetch to track upload progress.
Read more >showing download progress while downloading a file using ...
I am developing a download manager using PHP and jquery. Requested a script that will download a file and also show the download...
Read more >How to show the progress of a download - LiveCode Lessons
Compile the script, close the editor and change to the browse tool. Then click the button to test it.
Read more >Download file using Javascript and show remaining time
Download file inside browser before IDM- Get remaining time in file download - Get download speed- Show progress bar with downloadSource ...
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

Ok got it. Thanks
I noticed that this is not mentioned in the documentation, will add it!