Skip to content

[bug] iOS file picker filter, selection, and security-scoped resource issuesΒ #3030

@velocitysystems

Description

@velocitysystems

Describe the problem

On iOS, when using plugin-dialog to select a file, the API does not behave as expected when filtering or selecting files.
Custom file extensions (e.g. .foo) appear in the picker but cannot be selected. Additionally, unless MIME types or known extensions (like "txt") are passed, the picker defaults to an image picker instead of a file picker β€” two distinct modes on iOS.

Further, proper handling of security-scoped resources is missing or incomplete, which is required for persistent file access on iOS.

Repro (a)

  1. Open the file picker via the Tauri plugin on an iOS device.
  2. Provide a custom file type filter (e.g. ["foo", "bar"]).
  3. Observe that matching files appear in the picker but cannot be selected.

Repro (b)

  1. Open the file picker via the Tauri plugin on an iOS device.
  2. Try calling the picker without MIME types or standard extensions (e.g. "txt").
  3. Note that an image picker appears instead of the expected file picker.

Describe the solution you'd like

Files with custom extensions in the filter should be selectable.

  • The picker should open the UIDocumentPickerViewController (file picker), not the UIImagePickerController (image picker), when no image MIME types are provided.
  • Returned file handles should properly include security-scoped resource access, allowing safe reading and writing of files outside the app sandbox.

Alternatives considered

N/A

Related

#3029
#1578
#1596
#3716
PR 2061

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions