Mime-Detective-clarkis117
Mime-Detective-clarkis117 copied to clipboard
Csv detected as wav
Hi,
Is csv supported? I've tried to detect a csv, but the file is detected as wav.
Thanks,
I have tried to detect a csv as well, but it couldn't detect any mime type at all. It was just a semicolon-separated csv file. Apart from that, nothing special about it.
Duplicate of #30 ?
Can you show us the starting bytes of the file? In hex? To do that, you can use Visual Studio > Open file, select the file, Open with..., Binary editor.
This is not really documented here but I have to say that detecting text files is an almost impossible task. Complex files (zip, png, mp3...) often use distinguishable bytes at the beginning of the file. Text files and random files don't. So we cannot detect them objectively. And if you add the issue of detecting the encoding, then the task gets event harder.
I recommend using multiple mechanisms for your task. First use MimeDetective to detect a known file type. If it returns null, then the file may be a text file. Use other mechanisms to detect specific files (CSV, XML...).
Does that help you?