Skip to content

FilePickerFile

Metadata for a file selected via pick_files.

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

属性 ​

名称类型默认值说明
idintrequiredSelection-scoped file identifier assigned by Flet. This value is stable for the current picker selection and is preferred for upload matching in FilePickerUploadFile.
namestrrequiredFile name (basename), without directory path.
sizeintrequiredFile size in bytes.
pathOptional[str]NoneAbsolute 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.
bytesOptional[bytes]NoneFile contents. Returned only when pick_files is called with with_data=True. Otherwise this value is None.

关注我,学习大模型、大数据、Python等热门技术。