Skip to main content

FilePickerFile

Metadata for a file selected via flet.FilePicker.pick_files.

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

Properties

  • bytes - File contents.
  • id - Selection-scoped file identifier assigned by Flet.
  • name - File name (basename), without directory path.
  • path - Absolute path to the selected file, when available.
  • size - File size in bytes.

Properties

bytesclass-attributeinstance-attribute

bytes: Optional[bytes] = None

File contents.

Returned only when pick_files is called with with_data=True. Otherwise this value is None.

idinstance-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.

nameinstance-attribute

name: str

File name (basename), without directory path.

pathclass-attributeinstance-attribute

path: Optional[str] = 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.

sizeinstance-attribute

size: int

File size in bytes.