I’m using a FileDialogBuilder
in a Tauri app to let a user select a file for processing. Although the input files will often have one of a particular set of extensions, I’d like the dialog to also allow selecting a file without regard for its extension.
The following code presents a dialog with options to show only files that end in “.foo” or “.bar”, or to show files with any extension, but I can’t work out how to include files that don’t have an extension at all.
#[tauri::command]
async fn pick_a_file() -> Option<PathBuf> {
FileDialogBuilder::new()
.add_filter("Specific extension", &["foo", "bar"])
.add_filter("Any extension", &["*"])
.add_filter("No extension", &[""]) // ???
.pick_file()
}