Why can the mp4 video content type be text / open?

I was developing an application that can get the URL of a file and has to do different things depending on the type of file (audio, video, image). Therefore, I get the file content type like this:

URLConnection connection = url.openConnection(); connection.connect(); String contentType = connection.getContentType(); 

I tried with some jpg and mp3 files, and the type of content is expected, but I have a problem with the video on this network (I just used it by accident) http://www.yo-yo.org/mp4/ I tried this with TestFour video ( http://www.yo-yo.org/mp4/yu5.mp4 ) and I Receive the following content type:

 text/plain; charset=UTF-8 

I expected to get "video / mp4".

Can someone explain why I get this type of content?

Thanks.

UPDATE

I also tried with another video in http://people.sc.fsu.edu/~jburkardt/data/mp4/claw_pix_example01_movie.mp4 and this happens the same thing.

Same thing with http://www.easydnnsolutions.com/Portals/0/EasyGalleryImages/1/18/Alice_in_Wonderland_Teaser_1.mp4

In all of them, I get the same type of content.

+4
source share
1 answer

The MIME server configuration is probably incorrect and is the source of the problem.

+7
source

Source: https://habr.com/ru/post/1340791/


All Articles