Skip to content
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

AsyncFileDialog in web context show some kind of progress bar ? #204

Open
fmartinsons opened this issue Jul 4, 2024 · 0 comments
Open

Comments

@fmartinsons
Copy link

Hello,

I'm using egui for building a web app and I use rfd to offer the user to pick a file. Some of file candidate can be big and/or hosted on a low bandwith network drive so when I do something like:

let task = rfd::AsyncFileDialog::new()
    .set_title("Choose a file please")
    .pick_file();
wasm_bindgen_futures::spawn_local(async move {
    let file = task.await;
    if let Some(file) = file {
        let contents = file.read().await;
    }
});

The call to file.read() can take several dozen of seconds (even more) , in the UI, I'm currently showing a spinner saying "loading in progress" but I would like to display some kind of progress bar showing the percentage of file downloaded.

I see rfd used web_sys FileReader and this class seems to have some kind of "progress" support with set_onprogress.

I must admit that I know very little in the web/js world so it may be a silly question but do you think it is something achievable ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant