Restagent\Request::content_mime_type PHP Method

content_mime_type() public method

public content_mime_type ( $content ) : void
$content content of a file in a string buffer format.
return void
    public function content_mime_type($content)
    {
        $ftype = 'application/octet-stream';
        if (function_exists("finfo_file")) {
            $finfo = new finfo(FILEINFO_MIME_TYPE | FILEINFO_SYMLINK);
            $fres = $finfo->buffer($content);
            if (is_string($fres) && !empty($fres)) {
                $ftype = $fres;
            }
        }
        return $ftype;
    }