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

.xls file shows null in return of getMimeType #85

Open
keivanshir opened this issue Aug 2, 2022 · 0 comments
Open

.xls file shows null in return of getMimeType #85

keivanshir opened this issue Aug 2, 2022 · 0 comments

Comments

@keivanshir
Copy link

keivanshir commented Aug 2, 2022

Hi @j256 told me to put this issue here. I use this code to get the Mime Type of the excel file but it shows null in mimeType of ContentInfo. I can get the file format from message and name properties but I really need the mimeType
and extension. I've attached the file so you can test it too.

try {
   ContentInfoUtil util = new ContentInfoUtil();
   InputStream stream = new FileInputStream(file);
   ContentInfo info = util.findMatch(stream);
   
   if (info != null) {
       String mimeType1 = info.getMimeType();
   }
} catch (Exception e){
   e.printStackTrace();
}

1.xls

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

1 participant