tauri-apps / tauri-apps/plugins-workspace

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

Open
#3,030 5 comments 2 reactions 0 assignees View on GitHub
platform: ios plugin: dialog type: bug type: feature request
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the problem

On iOS, when using [plugin-dialog](https://v2.tauri.app/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](https://github.com/tauri-apps/tauri/issues/3716)
[PR 2061](https://github.com/tauri-apps/plugins-workspace/pull/2061)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.