Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8851

Re: MIME type of File

$
0
0

hi deeplak ,

 

 

use this code to determine

 

String mimeType =Magic.getMagicMatch(file,false).getMimeType();

 

for this  you have to use the jmime magic libraries which is available in the below link .

 

http://sourceforge.net/projects/jmimemagic/

 

if you dont want to user external jar you can use standard java

FileinputStream  fileinptstrm = null ;

fileinptstrm =newBufferedInputStream(newFileInputStream(fileName));
 
String mimeType =URLConnection.guessContentTypeFromStream(fileinptstrm);

Regards

Govardan Raj


Viewing all articles
Browse latest Browse all 8851

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>