UploadedFile
An abstract uploaded file (TemporaryUploadedFile and
InMemoryUploadedFile are the built-in concrete subclasses).
An ``UploadedFile`` object behaves somewhat like a file object and
represents some file data that the user submitted with a form.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | string | The sanitized name of the uploaded file, restricted to the basename and a maximum length of 255 characters to ensure safe storage across different operating systems. |
Constructor
Signature
def UploadedFile(
file: file-like object = None,
name: str = None,
content_type: str = None,
size: int = None,
charset: str = None,
content_type_extra: dict = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| file | file-like object = None | The underlying file-like object. |
| name | str = None | The name of the uploaded file. |
| content_type | str = None | The MIME type of the file (e.g., image/jpeg). |
| size | int = None | The size of the file in bytes. |
| charset | str = None | The character set of the file (e.g., utf-8). |
| content_type_extra | dict = None | Extra parameters for the content-type header. |