I've just used the dialog plugin to create a dialog. I'm not using the open file but I would like to share a snipped of what I did to open a dialog for Tauri V2 from Rust.
use tauri_plugin_dialog::DialogExt;
#[tauri::command]
fn app_exit (app: AppHandle)
{
let is_confirmed = app.dialog()
.message("Confirm quit?")
.title("Quit")
.kind(tauri_plugin_dialog::MessageDialogKind::Info)
.buttons(tauri_plugin_dialog::MessageDialogButtons::YesNo)
.blocking_show();
if is_confirmed
{
app.exit(0);
}
}
Link to the documentation if it could be useful: