Is there a way to detect the mime type of a file without actually having an actual file, for example when you're generating the file and serving it as a download?
I'm currently using file extension sniffing from here: http://www.php.net/manual/en/function.mime-content-type.php#87856
I was just wondering if there was another way short of actually creating the file on the server and using FileInfo, mime_content_type(), or file