Solved

Internet Explorer wont recognise uppercase file extensions (Tomcat application)

Posted on 2016-08-18
7
52 Views
Last Modified: 2016-08-29
I have a Ubuntu server running apache webserver and Tomcat; also Win7 client + IE11, FF, Chrome:

I understand that, as Ubuntu (Linux) differs upper from lowercase, it does make a diffence from default.jpg to default.JPG ..

Now in our Tomcat application thumbnails of *.JPG do not show up, but only in Internet Explorer (11).
Chrome and Firefox seem to not care very much - no problems.

So I guess I have to add the uppercase MIME types to the web.xml - but I would like to know, why/how IE handles MIME Types differently to other browsers?
Of couse, it is strongly entagled with Windows OS which itself also does not differ upper and lowercase.. So is the root cause of this, how the mime types are defined (in the registry?) and processed by different browsers (Chrome/FF handling MIME types on their own)?

Can somebody confirm this and/or give a more detailed reason?
0
Comment
Question by:Systemadministration
  • 4
  • 3
7 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41762073
That is very odd.  I have never had that happen.  The web server is the thing that recognizes the file names, the browser just sends them in the request.  I don't think there are 'uppercase MIME' types.  Can you give some sample files links that are loaded differently by IE and the other browsers?
0
 

Assisted Solution

by:Systemadministration
Systemadministration earned 0 total points
ID: 41762086
Thanks for you comment.
Well, as Linux machines (= our webb/app server) are case sensitive. So are the MIME types:
http://stackoverflow.com/questions/9575756/servlet-for-file-upload-contenttype-returning-none-when-file-extension-in-ca
---
I can give more than an example, this is the network traffic logged by IE, see attachment.
---
So to fix this I would need to define uppercase MIME types in my tomcat web.xml.
But I would like to know, why IE handles this differently from Chrome/FF.
If I was very mean I would say: "Once again IE seems more stupid than any other browser"..
2016-08-19-09_43_19-Clipboard-johnen.jpg
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41762141
Several things.  You are having a problem with file extensions, not MIME types.  They are not the same.  Here is the 'official' list of MIME types:  https://www.iana.org/assignments/media-types/media-types.xhtml

If the 'mime-mapping' works for you, use it.  But that is an artifact of Tomcat and/or JAVA.
<mime-mapping>
    <extension>JPG</extension>
    <mime-type>image/jpeg</mime-type>
</mime-mapping>

Open in new window


There is no reason for IE and Firefox to be acting differently that I know of.  On my Linux Apache sites, they don't act differently.  Maybe if you capture the headers from both you will see a difference.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Accepted Solution

by:
Systemadministration earned 0 total points
ID: 41762163
That's hair-splitting now :)
Case-sensitve handling of file extensions causing running into indefined MIME types..
--
I noticed another thing, which might make a difference - you couldn't see on the first screenshot:
The image URL is like:
.../default.jpg?version=1471527238374&name=uppercase.JPG
resp.
.../default.jpg?version=1471527238374&name=lowercase.jpg
--
Maybe Chrome and FF interpret the MIME type from "default.jpg" => ignoring the paramters and following extensions;
While IE takes "the last file extension it gets" => causing the difference of upper and lowercase...(?)
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41762247
All that is possible.  I think the difference is Tomcat and whatever goes on there.  I don't have any experience with Tomcat.  My experience with hundreds of pages on Linux and Apache have never shown IE to have this problem.  But I also have never used URLs like that.  The only time I see URLs like that are when the first file name is actually a program and not an image.
0
 

Author Comment

by:Systemadministration
ID: 41766370
Well I guess if there is noone else with a comparable scenario responding, I will stick with my assumptions, even though it's slightly unsatisfying..
0
 

Author Closing Comment

by:Systemadministration
ID: 41774474
Other comments did not bring in further/additional information.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question