Need to know the MIME Types of file without program file name don't have any extension
Asked
Active
Viewed 49 times
0
-
You should add at least a code example of what you have tried. And of course add tags for your programming language. – mrkernelpanic Aug 20 '18 at 08:48
-
can't we find without programming language ? if No then i will prefer JAVA – Mahesh Chaudhary Aug 20 '18 at 08:51
-
Even if it did have an extension, that would not tell you, because each extension could correspond to multiple types. – Raedwald Aug 20 '18 at 09:06
1 Answers
1
You can try to find it out using plain Java from an InputStream
.
String mimeType = URLConnection.guessContentTypeFromStream(is);
Or you just check out the source code from guessContentTypeFromStream
and open your file in an Editor and compare the hex values yourself.

mrkernelpanic
- 4,268
- 4
- 28
- 52