Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Csv detected as wav #31

Open
1100594 opened this issue Dec 12, 2018 · 2 comments
Open

Csv detected as wav #31

1100594 opened this issue Dec 12, 2018 · 2 comments

Comments

@1100594
Copy link

1100594 commented Dec 12, 2018

Hi,

Is csv supported? I've tried to detect a csv, but the file is detected as wav.

Thanks,

@brunoRyckaert
Copy link

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.

@sandrock
Copy link

sandrock commented May 5, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants