public static function getFromFile($path)
    {
        if (!($path instanceof File))
            $path = new File($path);

        $ext = $path->getExtension();
        $path = $path->getFullPath();

        $type = new FileType($ext ?? "", "");
        if (empty($type->getMimeType()) && file_exists($path))
            $type->setMimeType(mime_content_type($path));

        return $type;
    }
public static function getFromFile($path)
    {
        if (!($path instanceof File))
            $path = new File($path);

        $ext = $path->getExtension();
        $path = $path->getFullPath();

        $type = new FileType($ext ?? "", "");
        if (empty($type->getMimeType()) && file_exists($path))
            $type->setMimeType(mime_content_type($path));

        return $type;
    }
public static function getFromFile ( $ path ) { if ( ! ( $ path instanceof File ) ) $ path = new File ( $ path ) ; $ ext = $ path -> getExtension ( ) ; $ path = $ path -> getFullPath ( ) ; $ type = new FileType ( $ ext ?? "" , "" ) ; if ( empty ( $ type -> getMimeType ( ) ) && file_exists ( $ path ) ) $ type -> setMimeType ( mime_content_type ( $ path ) ) ; return $ type ; }
Return the mime type based on a file name
@param string $path The path to the file
@return FileType The File Type for this file
Return the mime type based on a file name