Skip to content

Cross Platform File Selection API #3850

@mcmah309

Description

@mcmah309

Feature Request

Dioxus should have a cross platform api for programmatic file selection/saving.

Currently, we can use

rsx! {
    input { r#type: "file" }
}

for file selection on web and desktop, and once #3849 is resolved, mobile as well. Thus giving us a cross platform file selection element.

But there is no direct file selection api that can be invoked programmatically. On desktop we can use rfd directly with e.g. rfd::FileDialog::new().set_directory(&path).pick_file();, but this does not work for web or mobile. Thus there should be an api that can be used directly that covers web, desktop, and eventually mobile.

On web, the set_directory option should be ignored, since browsers are sandboxed so it will not have an effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions