You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
my way to get android files real path when flet run --android. #203
flet version=0.28.2
devices= android phone, proot-ubuntu
use flet for android app as display after run flet run --android.
issue
flet filepicker only get cache path for selected file instead real path
how to get real path: think out of box:
Strategy
1.Extract` filename from FilePickerResultEvent.
obtain directory path from get_directory_path().
Reconstruct real path using:
`os.path.join(real_dir_path, extracted_filename)
below is example of my file_picker code to get real path of selected file:
def pick_files_result(e: ft.FilePickerResultEvent, selected_files: ft.TextField):
if e.files:
real_folder = selected_folder_path.value # use the folder picked via get_directory_path
selected_paths = []
for f in e.files:
filename = os.path.basename(f.name or f.path) # get file name
if real_folder:
full_real_path = os.path.join(real_folder, filename)
selected_paths.append(full_real_path)
else:
selected_paths.append(f.path or f.name)
selected_files.value = ", ".join(selected_paths)
selected_files.update()
selected_folder_path = ft.TextField(visible=False)
def get_directory_result(e: ft.FilePickerResultEvent, directory_path: ft.TextField):
if e.path:
directory_path.value = e.path
selected_folder_path.value = e.path # store for use in pick_files_result
directory_path.update()
Activity