tauri-apps / tauri-apps/plugins-workspace

[android - fs] Writing to a file provided via dialog (content:// URI) results in a 0 byte file in the Documents picker

Open
#3,356 1 comment 1 reaction 0 assignees View on GitHub
platform: android plugin: fs type: bug
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

### Describe the bug

If you get a URI via the dialog plugin `dialog.save()` and then write to it via `fs.writeFile()`, the resulting document will be written, but it will be seen as being empty by other applications and Android's documents picker.

### Reproduction

- `const uri = await dialog.save()`
- Choose the Downloads folder for example
- `await fs.saveFile(uri, "test")`
- Open the Documents UI and see that the file is listed as having 0 bytes

### Expected behavior

_No response_

### Full `tauri info` output

```text
[✔] Environment
- OS: Artix Linux Rolling Release x86_64 (X64) (Unknown DE on wayland)
✔ webkit2gtk-4.1: 2.50.6
✔ rsvg2: 2.61.4
✔ rustc: 1.86.0 (05f9846f8 2025-03-31)
✔ cargo: 1.86.0 (adf9b6ad1 2025-02-28)
✔ rustup: 1.28.2 (2026-02-27)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (overridden by environment variable RUSTUP_TOOLCHAIN)
- node: 25.8.1
- yarn: 1.22.22
- npm: 11.11.1
- deno: deno 2.7.7

[-] Packages
- tauri 🦀: 2.10.2
- tauri-build 🦀: 2.5.5
- wry 🦀: 0.54.1
- tao 🦀: 0.34.5
- tauri-cli 🦀: 2.7.0
- @tauri-apps/api : 2.10.1
- @tauri-apps/cli : 2.6.3

[-] Plugins
- tauri-plugin-biometric 🦀: 2.3.2
- @tauri-apps/plugin-biometric : 2.3.2
- tauri-plugin-opener 🦀: 2.5.3
- @tauri-apps/plugin-opener : 2.5.3
- tauri-plugin-process 🦀: 2.3.1
- @tauri-apps/plugin-process : 2.3.1
- tauri-plugin-dialog 🦀: 2.6.0
- @tauri-apps/plugin-dialog : 2.6.0
- tauri-plugin-os 🦀: 2.3.2
- @tauri-apps/plugin-os : 2.3.2
- tauri-plugin-store 🦀: 2.4.2
- @tauri-apps/plugin-store : 2.4.2
- tauri-plugin-fs 🦀: 2.4.5
- @tauri-apps/plugin-fs : 2.4.5
- tauri-plugin-http 🦀: 2.5.7
- @tauri-apps/plugin-http : 2.5.7

[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../dist
- devUrl: http://localhost:5173/
- framework: Vue.js
- bundler: Vite
```

### Stack trace

```text

```

### Additional context

_No response_

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.