Skip to content

FilePickerFile

Metadata for a file selected via FilePicker.pick_files().

Returned by FilePicker.pick_files() and used as input context for FilePickerUploadFile when uploading selected files.

Properties

  • id(int) –

    Selection-scoped file identifier assigned by Flet.

  • name(str) –

    File name (basename), without directory path.

  • path(str | None) –

    Absolute path to the selected file, when available.

  • size(int) –

    File size in bytes.

Properties#

id instance-attribute #

id: int

Selection-scoped file identifier assigned by Flet.

This value is stable for the current picker selection and is preferred for upload matching in FilePickerUploadFile.

name instance-attribute #

name: str

File name (basename), without directory path.

path class-attribute instance-attribute #

path: str | None = None

Absolute path to the selected file, when available.

Note
  • Web mode always returns None.
  • On native platforms, this can still be None if the platform picker does not expose a filesystem path.

size instance-attribute #

size: int

File size in bytes.