We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! Can't upload a file from mobile to the app! It shows ErroNo2 No file or directory.
import flet as ft import shutil # Funkcja uruchamiająca wybór pliku def upload_image(result, page): if result.files and len(result.files) > 0: file = result.files[0] # Przesyłanie pliku i analiza obrazu analyze_and_upload_image(file, page) else: page.add(ft.Text("Nie wybrano pliku.", color=ft.colors.RED)) # Funkcja do analizy obrazu def analyze_and_upload_image(file, page): try: # Generowanie unikalnych nazw plików na podstawie czasu input_image_path = f"images/{file.name}" output_image_path = f"results/{file.name}" # Zapisz plik w folderze aplikacji with open(input_image_path, "wb") as f: shutil.copy(file.path, input_image_path) # Dodanie obrazu do strony i wyśrodkowanie go page.add(ft.Image(src=input_image_path, width=300, height=400, fit=ft.ImageFit.CONTAIN)) except Exception as e: # Wyświetlenie błędu w aplikacji page.add(ft.Text(f"Błąd: {str(e)}", color=ft.colors.RED)) # Funkcja uruchamiająca stronę i przycisk do otwarcia FilePicker def pyShotPage(page: ft.Page): page.clean() # Inicjalizacja FilePicker z odpowiednimi ustawieniami file_picker = ft.FilePicker(on_result=lambda e: upload_image(e, page)) # Dodanie FilePicker do overlay page.overlay.append(file_picker) # Przycisk do wybrania pliku page.add( ft.Column( [ ft.Text("Prześlij zdjęcie do analizy", size=16, weight=ft.FontWeight.BOLD, text_align="center"), ft.ElevatedButton( "Prześlij zdjęcie", width=200, height=50, style=ft.ButtonStyle( shape=ft.RoundedRectangleBorder(radius=10), padding=20, ), on_click=lambda _: file_picker.pick_files( allow_multiple=False, file_type=ft.FilePickerFileType.IMAGE ), ), ], alignment=ft.MainAxisAlignment.CENTER, horizontal_alignment=ft.CrossAxisAlignment.CENTER, expand=True, ) ) # Uruchamiamy aplikację ft.app(target=pyShotPage)
No response
macOS
Ios 18.2
Version: 0.25.2
No, it isn't
[Paste your logs here]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Duplicate Check
Describe the bug
Hi!
Can't upload a file from mobile to the app! It shows ErroNo2 No file or directory.
Code sample
To reproduce
Expected behavior
No response
Screenshots / Videos
Captures
Operating System
macOS
Operating system details
Ios 18.2
Flet version
Version: 0.25.2
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response
The text was updated successfully, but these errors were encountered: