How to detect type of file stream?
I have used magic_file() and magic_buffer() from libmagic to detect file type for files on disk and in memory. I have a requirement to determine type of a file stream. I’ll have to pass multiple sequential fragments of the file being downloaded to the interface and get the file’s mime type after the last fragment is parsed. Is there any file type detection engine (preferably in C) that supports this ?