Skip to content
New issue

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

FilePicker and uploads #258

Merged
merged 11 commits into from
Sep 2, 2022
Merged

FilePicker and uploads #258

merged 11 commits into from
Sep 2, 2022

Conversation

FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Sep 1, 2022

New methods and properties:

  • page.get_upload_url(file_name, expires)
  • page.overlay: List[Control]

New attribute in flet.app():

flet.app(target=main, upload_dir="uploads")

Fletd environment variable: FLET_UPLOAD_ROOT_DIR

New FilePicker control:

  • dialog_title: str
  • initial_directory: str
  • file_name
  • file_type
  • allowed_extensions
  • allow_multiple
  • result: FilePickerResultEvent
  • on_result
  • on_upload (FilePickerUploadEvent)
  • pick_files(dialog_title, initial_directory, file_type, allowed_extensions, allow_multiple)
  • save_file(dialog_title, file_name, initial_directory, file_type, allowed_extensions)
  • get_directory_path(dialog_title, initial_directory)
  • upload(files: List[FilePickerUploadFile])

FilePickerUploadFile class:

  • name
  • upload_url
  • method (PUT (default), POST)

FilePickerUploadEvent class:

  • file_name
  • progress
  • error

FilePickerResultEvent class:

  • path
  • files: List[FilePickerFile]

FilePickerFile class:

  • name: str
  • path
  • size

@FeodorFitsner FeodorFitsner merged commit cda6995 into main Sep 2, 2022
@FeodorFitsner FeodorFitsner deleted the file-uploads branch September 2, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant