为什么MimetypesFileTypeMap总是返回"application/octet-stream"?为PNG文件? [英] Why does MimetypesFileTypeMap always return "application/octet-stream" for PNG file?
本文介绍了为什么MimetypesFileTypeMap总是返回"application/octet-stream"?为PNG文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用javax.activation.MimetypesFileTypeMap
来获取内容类型.
I'm trying to use javax.activation.MimetypesFileTypeMap
to get the content type.
对于字符串"image.png",它总是返回"application/octect-stream" ...它不应该返回诸如"image/png"之类的东西吗?
For the string "image.png" it always returns "application/octect-stream" ... shouldn't it return something like "image/png" ?
javax.activation.MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType("image.png");
推荐答案
查看全文