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.
The server MIME configuration is likely incorrect and the source of the problem.