• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:41
CEST 05:41
KST 12:41
  • 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
Team Liquid Map Contest #22 - The Finalists9[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy21
Community News
2026 GSL Season 1 Qualifiers5Maestros of the Game 2 announced22026 GSL Tour plans announced4Weekly Cups (April 6-12): herO doubles, "Villains" prevail0MaNa leaves Team Liquid18
StarCraft 2
General
Team Liquid Map Contest #22 - The Finalists 2026 GSL Tour plans announced Maestros of the Game 2 announced Weekly Cups (April 6-12): herO doubles, "Villains" prevail MaNa leaves Team Liquid
Tourneys
2026 GSL Season 1 Qualifiers Master Swan Open (Global Bronze-Master 2) SEL Doubles (SC Evo Bimonthly) Sparkling Tuna Cup - Weekly Open Tournament $5,000 WardiTV TLMC tournament - Presented by Monster Energy
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 521 Memorable Boss The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power
Brood War
General
ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Data needed A cwal.gg Extension - Easily keep track of anyone [ASL21] Ro16 Preview Pt1: Fresh Flow
Tourneys
[ASL21] Ro16 Group B [ASL21] Ro16 Group A [ASL21] Ro24 Group F [Megathread] Daily Proleagues
Strategy
What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates Muta micro map competition
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread General RTS Discussion Thread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Reappraising The Situation T…
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2385 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
Netherlands10342 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
Netherlands10342 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
Netherlands10342 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
PiGosaur Cup
00:00
#77
PiGStarcraft637
CranKy Ducklings93
EnkiAlexander 65
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft637
RuFF_SC2 208
-ZergGirl 76
StarCraft: Brood War
GuemChi 5972
Sea 4069
Noble 23
Leta 18
Icarus 1
Dota 2
febbydoto16
Counter-Strike
taco 289
m0e_tv79
Super Smash Bros
hungrybox493
Other Games
summit1g10190
tarik_tv5268
C9.Mang0356
Maynarde155
ViBE130
Mew2King20
Organizations
Other Games
gamesdonequick733
Counter-Strike
PGL127
Other Games
BasetradeTV115
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• practicex 14
• CranKy Ducklings SOOP4
• sooper7s
• Migwel
• LaughNgamezSOOP
• IndyKCrew
• Kozan
• intothetv
• AfreecaTV YouTube
StarCraft: Brood War
• Azhi_Dahaki36
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo924
• Rush847
• Stunt839
Upcoming Events
Replay Cast
5h 19m
Kung Fu Cup
8h 19m
Replay Cast
20h 19m
The PondCast
1d 6h
WardiTV Map Contest Tou…
1d 7h
CranKy Ducklings
1d 20h
Escore
2 days
WardiTV Map Contest Tou…
2 days
OSC
2 days
Korean StarCraft League
2 days
[ Show More ]
CranKy Ducklings
3 days
WardiTV Map Contest Tou…
3 days
IPSL
3 days
WolFix vs nOmaD
dxtr13 vs Razz
BSL
3 days
Sparkling Tuna Cup
4 days
WardiTV Map Contest Tou…
4 days
Ladder Legends
4 days
BSL
4 days
IPSL
4 days
JDConan vs TBD
Aegong vs rasowy
Replay Cast
4 days
Replay Cast
5 days
Wardi Open
5 days
Afreeca Starleague
5 days
Bisu vs Ample
Jaedong vs Flash
Monday Night Weeklies
5 days
RSL Revival
5 days
Afreeca Starleague
6 days
Barracks vs Leta
Royal vs Light
WardiTV Map Contest Tou…
6 days
Liquipedia Results

Completed

Proleague 2026-04-13
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
StarCraft2 Community Team League 2026 Spring
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
2026 GSL S1
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
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.