• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 02:10
CET 08:10
KST 16:10
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)11Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns6[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises3
StarCraft 2
General
Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026 OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
I would like to say something about StarCraft Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Awesome Games Done Quick 2026! Mechabellum Beyond All Reason Stormgate/Frost Giant Megathread General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
All nighter for the AP Biology exam? US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1988 users

IE and MIME types

Blogs > Huanir
Post a Reply
Huanir
Profile Blog Joined May 2009
United States85 Posts
March 19 2010 19:18 GMT
#1
So apparently, Internet Explorer reports .jpg files as image/pjpeg instead of image/jpeg like everyone else does. Even the IETF RFCs use image/jpeg in their examples!

As one of the developers on a image-hosting site for a class project, I find this annoying. Why would Microsoft do this, and does anyone know what else they've changed?

*
Lord of the Rings was the greatest work of literature of the twentieth century, period. ~Orson Scott Card
love1another
Profile Blog Joined December 2009
United States1844 Posts
Last Edited: 2010-03-19 19:43:58
March 19 2010 19:41 GMT
#2
That's really strange. I'll see if I can find anything about this.

Edit: Check http://msdn.microsoft.com/en-us/library/ms775147(VS.85).aspx
"I'm learning more and more that TL isn't the place to go for advice outside of anything you need in college. It's like you guys just make up your own fantasy world shit and post it as if you've done it." - Chill
538
Profile Blog Joined November 2008
Hungary3932 Posts
March 19 2010 19:43 GMT
#3
lol, are you looking for a comprehensive list of things in which IE does not follow the general practice or the industry standards? Good luck with that

Seriously though, you must be really quite new to web-development i presume.
BW fighting!
love1another
Profile Blog Joined December 2009
United States1844 Posts
Last Edited: 2010-03-19 19:46:00
March 19 2010 19:45 GMT
#4
I think OP is referring only to different MIME handling. If you give a use case of where this is causing a problem, I can probably of be more help by suggesting certain workarounds.
"I'm learning more and more that TL isn't the place to go for advice outside of anything you need in college. It's like you guys just make up your own fantasy world shit and post it as if you've done it." - Chill
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 19 2010 19:59 GMT
#5
How does Internet Explorer "report" a mime type anyway? It's up to the web server to send the appropriate Content-type to the browser.
AdministratorTwitter: @R1CH_TL
TL+ Member
Aerox
Profile Blog Joined September 2004
Malaysia1213 Posts
Last Edited: 2010-03-19 20:30:04
March 19 2010 20:26 GMT
#6
On March 20 2010 04:59 R1CH wrote:
How does Internet Explorer "report" a mime type anyway? It's up to the web server to send the appropriate Content-type to the browser.

From the love1another's link:
The purpose of MIME type detection, or data sniffing, is to determine the MIME type (also known as content type or media type) of downloaded content using information from the following four sources:

-The server-supplied MIME type, if available
-An examination of the actual contents associated with a downloaded URL
-The file name associated with the downloaded content (assumed to be derived from the associated URL)
-Registry settings (file extension/MIME type associations or registered applications) in effect during the download


As for OP, I guess he just wanted a reason for IE not being standard... from same link:
In some cases, the detected MIME type can differ from the generally accepted value for backwards compatibility, as shown in the following table:

Standard MIME Type......... FindMimeFromData Returns
image/jpeg........ image/pjpeg
image/png.........image/x-png

Yeah, Netscape and IE were fucking around and trying to set their own standards and stuff back in the older days.

edit: Oh, OP asked "what else?". Uh, too much. LOL. Shouldn't be hard to google. I don't know if someone compiled a unified list yet but there should be mini lists like differences with CSS or HTML tags.... etc.
"Eyes in the sky."
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 19 2010 20:35 GMT
#7
I'm just wondering in what situation you would ever have it be an issue since a server-provided mime-type is issued in almost every circumstance. I'm guessing this has to do with opening files locally rather than from a web server?
AdministratorTwitter: @R1CH_TL
TL+ Member
love1another
Profile Blog Joined December 2009
United States1844 Posts
Last Edited: 2010-03-19 20:43:20
March 19 2010 20:39 GMT
#8
On March 20 2010 04:59 R1CH wrote:
How does Internet Explorer "report" a mime type anyway? It's up to the web server to send the appropriate Content-type to the browser.

But the web server generally doesn't give specifics. Octet stream, for example, is all a non-customized file transfer will say. It's up to the client, often, to determine what to do with the downloaded file. It usually figures this out based on the file extension.

On March 20 2010 05:35 R1CH wrote:
I'm just wondering in what situation you would ever have it be an issue since a server-provided mime-type is issued in almost every circumstance. I'm guessing this has to do with opening files locally rather than from a web server?


I requested a use case, because I had the same question... generally the server and client can decide the MIME type independently, so from the server's perspective, you don't really give a shit if Internet Explorer says the jpeg is a pjpeg. Likewise, if a client uploads a "pjpeg" type, the server generally uses its own algorithm for determining what the file is anyway. And I just realized your icon is MTG.
"I'm learning more and more that TL isn't the place to go for advice outside of anything you need in college. It's like you guys just make up your own fantasy world shit and post it as if you've done it." - Chill
Huanir
Profile Blog Joined May 2009
United States85 Posts
March 19 2010 20:44 GMT
#9
On March 20 2010 05:35 R1CH wrote:
I'm just wondering in what situation you would ever have it be an issue since a server-provided mime-type is issued in almost every circumstance. I'm guessing this has to do with opening files locally rather than from a web server?


Yeah, I want to restrict the types of files a user can upload, probably to jpegs, pngs, and gifs.
Lord of the Rings was the greatest work of literature of the twentieth century, period. ~Orson Scott Card
Huanir
Profile Blog Joined May 2009
United States85 Posts
March 19 2010 20:45 GMT
#10
On March 20 2010 04:45 love1another wrote:
I think OP is referring only to different MIME handling. If you give a use case of where this is causing a problem, I can probably of be more help by suggesting certain workarounds.


In the following code, uploading a jpeg in IE would follow the "Invalid file" path.

<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
}
else
{
echo "Invalid file";
}
?>
Lord of the Rings was the greatest work of literature of the twentieth century, period. ~Orson Scott Card
Huanir
Profile Blog Joined May 2009
United States85 Posts
March 19 2010 20:46 GMT
#11
And I know that checking for "image/pjpeg" would easily solve the issue, but I think this is an ugly workaround, considering that it's supposed to be standard.

XD @ Microsoft
Lord of the Rings was the greatest work of literature of the twentieth century, period. ~Orson Scott Card
love1another
Profile Blog Joined December 2009
United States1844 Posts
Last Edited: 2010-03-19 20:50:22
March 19 2010 20:47 GMT
#12
On March 20 2010 05:44 Huanir wrote:
Show nested quote +
On March 20 2010 05:35 R1CH wrote:
I'm just wondering in what situation you would ever have it be an issue since a server-provided mime-type is issued in almost every circumstance. I'm guessing this has to do with opening files locally rather than from a web server?


Yeah, I want to restrict the types of files a user can upload, probably to jpegs, pngs, and gifs.


Try reading this for an explanation of how it's done. http://www.bitrepository.com/how-to-validate-an-image-upload.html

Alternatively, check http://www.php.net/manual/en/function.getimagesize.php

There should be comparable functions for whatever language you're using.

If that stuff is TL;DR, then the key thing is don't trust what the client tells you. Figure the file type out yourself based on what's uploaded. Otherwise, what if I had a malicious client that sent you a malicious php script while telling you "lol, I'm a jpg let me through." I don't know if your configuration will be stupid enough to let this happen in practice, but it's still a bad idea.

Edit: And try not to triple post.
"I'm learning more and more that TL isn't the place to go for advice outside of anything you need in college. It's like you guys just make up your own fantasy world shit and post it as if you've done it." - Chill
Huanir
Profile Blog Joined May 2009
United States85 Posts
March 19 2010 20:57 GMT
#13
On March 20 2010 05:47 love1another wrote:
Show nested quote +
On March 20 2010 05:44 Huanir wrote:
On March 20 2010 05:35 R1CH wrote:
I'm just wondering in what situation you would ever have it be an issue since a server-provided mime-type is issued in almost every circumstance. I'm guessing this has to do with opening files locally rather than from a web server?


Yeah, I want to restrict the types of files a user can upload, probably to jpegs, pngs, and gifs.


Try reading this for an explanation of how it's done. http://www.bitrepository.com/how-to-validate-an-image-upload.html

Alternatively, check http://www.php.net/manual/en/function.getimagesize.php

There should be comparable functions for whatever language you're using.

If that stuff is TL;DR, then the key thing is don't trust what the client tells you. Figure the file type out yourself based on what's uploaded. Otherwise, what if I had a malicious client that sent you a malicious php script while telling you "lol, I'm a jpg let me through." I don't know if your configuration will be stupid enough to let this happen in practice, but it's still a bad idea.

Edit: And try not to triple post.


Many thanks; the links were indeed helpful (as was the mentality you suggested). And sorry about the triple-post. I didn't occur to me until after I'd posted them that I should have used Edit. v_v
Lord of the Rings was the greatest work of literature of the twentieth century, period. ~Orson Scott Card
R1CH
Profile Blog Joined May 2007
Netherlands10341 Posts
March 19 2010 21:06 GMT
#14
Oh, you should never trust the mime-type that the browser provides for file uploads. I could easily upload a .exe and claim it was an image/png if that's all you checked.

See http://shsc.info/FileUploadSecurity for more info about how to do this properly.
AdministratorTwitter: @R1CH_TL
TL+ Member
love1another
Profile Blog Joined December 2009
United States1844 Posts
March 19 2010 22:13 GMT
#15
Yay R1CH agrees with me!
"I'm learning more and more that TL isn't the place to go for advice outside of anything you need in college. It's like you guys just make up your own fantasy world shit and post it as if you've done it." - Chill
Please log in or register to reply.
Live Events Refresh
Next event in 1h 50m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft483
NeuroSwarm 134
StarCraft: Brood War
actioN 266
zelot 154
ZergMaN 69
JulyZerg 27
Larva 21
Noble 16
Icarus 7
League of Legends
JimRising 771
C9.Mang0198
Counter-Strike
summit1g9666
Super Smash Bros
hungrybox469
Other Games
Livibee131
ViBE93
Organizations
Other Games
gamesdonequick4498
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Berry_CruncH131
• practicex 37
• Kozan
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• LaughNgamezSOOP
• IndyKCrew
StarCraft: Brood War
• iopq 5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Rush1522
• Scarra1512
• Lourlo1138
• Stunt483
• HappyZerGling130
Upcoming Events
Replay Cast
1h 50m
Wardi Open
6h 50m
Monday Night Weeklies
9h 50m
WardiTV Invitational
1d 4h
WardiTV Invitational
2 days
The PondCast
3 days
OSC
3 days
OSC
4 days
All Star Teams
4 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
5 days
[ Show More ]
All Star Teams
5 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
6 days
OSC
6 days
Liquipedia Results

Completed

Proleague 2026-01-11
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
OSC Championship Season 13
Underdog Cup #3
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.