为什么 mp4 视频的内容类型可以是文本/纯文本?
我正在开发一个应用程序,它可以接收文件的 url,并且应该根据文件的类型(音频、视频、图像)执行不同的操作。所以我以这种方式获取文件的内容类型:
URLConnection connection = url.openConnection();
connection.connect();
String contentType = connection.getContentType();
我尝试过一些 jpg 和 mp3 文件,内容类型是预期的,但我在这个网络中的视频遇到问题(我只是偶然使用过)http://www.yo-yo.org/mp4/我已经尝试过视频 TestFour (http://www.yo-yo. org/mp4/yu5.mp4),我得到以下内容类型:
text/plain; charset=UTF-8
我期望得到“video/mp4”。
谁能解释一下为什么我会得到这种内容类型?
谢谢。
更新
我还尝试了另一个视频 http://people.sc.fsu.edu/~jburkardt/data/mp4/claw_pix_example01_movie.mp4,情况也是一样的。
在所有这些中,我都得到相同的内容类型。
I was developing an application which can receive a url of a file, and should do different things depending on the type of the file (audio, video, image). So I'm getting the content type of the file in this way:
URLConnection connection = url.openConnection();
connection.connect();
String contentType = connection.getContentType();
I've tried with some jpg and mp3 files and the content type is the expected one, but I'm having a problem with a video in this web (I just used it by chance) http://www.yo-yo.org/mp4/ I've tried it with the video TestFour (http://www.yo-yo.org/mp4/yu5.mp4) and I'm getting the following content-type:
text/plain; charset=UTF-8
I expected to get "video/mp4".
Can anyone explain why I'm getting this content type?
Thanks.
UPDATE
I have also tried with another video at http://people.sc.fsu.edu/~jburkardt/data/mp4/claw_pix_example01_movie.mp4 and it happens the same.
Also the same with http://www.easydnnsolutions.com/Portals/0/EasyGalleryImages/1/18/Alice_in_Wonderland_Teaser_1.mp4
In all of them I'm getting the same content type.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
服务器 MIME 配置可能不正确,这也是问题的根源。
The server MIME configuration is likely incorrect and the source of the problem.