Skip to main content

FilePickerUploadFile

Upload descriptor for one file selected by FilePicker.

Instances are passed to flet.FilePicker.upload. During upload, Flet resolves the selected file by id first and, when id is absent or not found, falls back to name.

At least one of id or name should be provided.

Properties

  • id - Selected file identifier returned by flet.FilePicker.pick_files.
  • method - HTTP method used for the upload request, usually PUT or POST.
  • name - Selected file name used as fallback lookup when id is missing or does not match any currently selected file.
  • upload_url - Upload destination URL.

Properties

idclass-attributeinstance-attribute

id: Optional[int] = None

Selected file identifier returned by flet.FilePicker.pick_files.

This is the preferred lookup key when both id and name are specified.

methodclass-attributeinstance-attribute

method: str = 'PUT'

HTTP method used for the upload request, usually PUT or POST.

nameclass-attributeinstance-attribute

name: Optional[str] = None

Selected file name used as fallback lookup when id is missing or does not match any currently selected file.

upload_urlinstance-attribute

upload_url: str

Upload destination URL.

Can be an absolute URL or a page-relative URL returned by flet.Page.get_upload_url.