1 2 3 4 5 6 7 8 9 10
use tauri_plugin_dialog::DialogExt; #[tauri::command] pub async fn open_file_dialog(app_handle: tauri::AppHandle) -> Option<String> { let (tx, rx) = tokio::sync::oneshot::channel(); app_handle.dialog().file().pick_file(move |path| { let _ = tx.send(path); }); rx.await.ok().flatten().map(|p| p.to_string()) }