Replies: 1 comment
-
Discussion expanded to tauri-apps/plugins-workspace#2749 In general, mobile file handling is not implemented that nicely in tauri yet but the dialog + fs plugin are supposed to get you quite far. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
question eg

My code works on Windows and macOS, but on Android the file path starts with content://, causing file read failures.
How can I handle file reading properly on Android/iOS? Is there a universal API? Example scenario: Changing a user avatar requires selecting an image. On PC, I can directly open a file dialog without permission checks, but mobile apps need to:
1、Request permissions
2、Open gallery/folder
3、Read the image file.
How to implement this flow correctly?How to get the correct path to the file?
问题 zh

这是我的代码,他在win和mac能正常运行,但是在安卓上拿到的文件地址是content开头的,导致我不能正常读取文件
请问如果我想要在安卓或者ios上能正常读取文件的话我应该怎么处理,有通用的api使用吗?
例如有个场景,我需要更换头像,那我就需要拿到图片,我需要打开文件对话框,pc端可能不需要询问权限,直接选中对应的图片文件,app上的话
1、先询问权限
2、相册或者文件夹去选中图片
我还注意到tauri-apps/plugin-fs
那么对于询问权限和打开相册已经读取图片文件如何做?如何才能正确的拿到文件的路径
Beta Was this translation helpful? Give feedback.
All reactions