主题
FilePickerFile
Metadata for a file selected via pick_files.
Returned by pick_files and used as input context for FilePickerUploadFile when uploading selected files.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
id | int | required | 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 | str | required | File name (basename), without directory path. |
size | int | required | File size in bytes. |
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. |
bytes | Optional[bytes] | None | File contents. Returned only when pick_files is called with with_data=True. Otherwise this value is None. |