from_media_type method
Leave feedback
On this page
Maps a file media type to a FileType (e.g., ‘application/pdf’ maps to FileType.pdf).
def from_media_type(cls, media_type):
...
| Parameter | Type | Description |
|---|---|---|
| media_type | str |
File media type, e.g., application/pdf. |
Returns: FileType: Corresponding file type when found; otherwise returns the default FileType.unknown.
- class
FileType
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.