flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.17k stars 429 forks source link

FilePicker Not Working Properly In Android and Web #4149

Open Siva-Rajan-R opened 1 week ago

Siva-Rajan-R commented 1 week ago

Duplicate Check

Describe the bug

When I Try To Get A File In Android And Web It Shows An Error. But Windows It Works Fine,

For Android ,It Show There Is No File Or Directory ;

Future exception was never retrieved

future: <Future finished exception=FileNotFoundError(2, 'No such file or directory')> Traceback (most recent call last): File "C:\Users\aarthi\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aarthi\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_core\page.py", line 944, in wrapper handler(args) File "C:\python_project\Sell_Any_Flet_App\main.py", line 2779, in pick_file_chat with open(path,'rb') as fr: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/data/user/0/com.appveyor.flet/cache/file_picker/1728736726850/1000008325.jpg'

For Web , If I Select A FIle It Only Give The File Name , The File Path Is Set TO Be None ;

Future exception was never retrieved

future: <Future finished exception=TypeError('expected str, bytes or os.PathLike object, not NoneType')> Traceback (most recent call last): File "C:\Users\aarthi\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aarthi\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_core\page.py", line 944, in wrapper handler(args) File "C:\python_project\Sell_Any_Flet_App\main.py", line 2779, in pick_file_chat with open(path,'rb') as fr: ^^^^^^^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not NoneType

Code sample

Code ``...` ```

To reproduce

...

Expected behavior

No response

Screenshots / Videos

Captures [Upload media here]

Operating System

Windows

Operating system details

windows 11

Flet version

0.24.1

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

OwenMcDonnell commented 3 days ago

Can you please re-format your issue and provide some reproducible code?