You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the undocumented (#220) progressHandler parameter you can use to display the progress when uploading a file.
I can't seem to find a way to track the progress of downloading a file.
This would be very useful when downloading large files.
Is it possible to get some sort of download progress currently in any way?
The text was updated successfully, but these errors were encountered:
Would need to implement this, just like uploadFile! The implementation would be similar to the uploadFile implementation described in #220 (PR's #221 and #225 show the code). Bandwidth to work on it is super slim at the moment unfortunately, but if you're willing, happy to review a PR and get it through!
Btw thank you for the PR to add it to the documentation for uploadFile. Touched it up a tiny bit here
Technically you could also just get the file in byte ranges using the range param, and with each iteration, log the progress, like this:
const CHUNK_SIZE = 512 * 1024
let position = 0
while (position < file.size) {
const chunkResult = await userbase.getFile({ databaseName, fileId, range: { start: position, end: position + CHUNK_SIZE } })
const bytesRetrieved = position + chunkResult.file.size
const progress = bytesRetrieved / file.size
console.log(progress)
// you'll also want to place the chunk in an array, and then rebuild the file when the while loop finishes
position += CHUNK_SIZE
}
I found the undocumented (#220)
progressHandler
parameter you can use to display the progress when uploading a file.I can't seem to find a way to track the progress of downloading a file.
This would be very useful when downloading large files.
Is it possible to get some sort of download progress currently in any way?
The text was updated successfully, but these errors were encountered: