Replies: 2 comments
-
There should be no api that requires the use of BaseDirectory. It should always be optional unless i forgot some api here.
Try
This is an OS error, completely uncoupled from tauri's permission system. (Tauri cannot really affect/restrict the Rust side anyway) The only thing i can think of on macOS, apart from a generally protected path (if that exists on macos), is the |
Beta Was this translation helpful? Give feedback.
-
@maxbodin, I have written about file management in Tauri 2.0 here. No |
Beta Was this translation helpful? Give feedback.
-
Allowing File Access from Anywhere in Tauri v2
Description
Hello everyone, I'm encountering an issue while developing a Tauri v2 application. The goal of my app is to allow users to access any type of file, regardless of its location on their computer. However, I'm running into what seems to be strict restrictions imposed by Tauri on file access.
Problem Details
Initially, I tried using the
@tauri-apps/plugin-dialog
to let users select files. However, the need to specify aBaseDirectory
makes it overly restrictive. Even after updating the scopes of thefs
plugin with "*", I was still unable to access files freely.I then attempted to implement a backend command to read files directly using the following Rust code:
In the frontend, I invoked the command like this:
Unfortunately, this results in a PermissionDenied error:
Question
My Thoughts
While I understand the importance of security, I find these restrictions too limiting for many practical use cases. Users should be able to open files from anywhere on their system without running into PermissionDenied errors. The current design feels overly restrictive and makes me question how suitable Tauri is for building such applications.
If anyone has suggestions or workarounds, I would greatly appreciate your help!
Beta Was this translation helpful? Give feedback.
All reactions