from_media_type method

On this page

from_media_type

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.

See Also

On this page