Call method
getMimeType("file://"
+ dosPath)
public static String
getMimeType(String fileUrl) throws java.io.IOException, MalformedURLException {
String
type = null;
URL
u = new URL(fileUrl);
URLConnection
uc = null;
uc
= u.openConnection();
type
= uc.getContentType();
return type;
}
No comments:
Post a Comment