• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:25
CET 01:25
KST 09:25
  • 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
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets0$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)15Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1823
StarCraft 2
General
SC2 All-Star Invitational: Jan 17-18 When will we find out if there are more tournament SC2 Spotted on the EWC 2026 list? Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) $25,000 Streamerzone StarCraft Pro Series announced WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026
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
[ASL21] Potential Map Candidates Potential ASL qualifier breakthroughs? A cwal.gg Extension - Easily keep track of anyone BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
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
Beyond All Reason Nintendo Switch Thread Awesome Games Done Quick 2026! Mechabellum Stormgate/Frost Giant Megathread
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
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread
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: 1433 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
BSL: GosuLeague
21:00
QUARTER FINALS
ZZZero.O91
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft459
Nathanias 131
CosmosSc2 56
StarCraft: Brood War
Artosis 478
Shuttle 169
ZZZero.O 91
Sexy 8
Dota 2
syndereN536
capcasts70
Counter-Strike
summit1g6383
Foxcn100
minikerr28
Super Smash Bros
hungrybox849
Mew2King86
PPMD48
Other Games
Liquid`RaSZi1889
Gorgc1880
FrodaN976
shahzam674
XaKoH 192
ToD164
C9.Mang0148
ViBE118
Maynarde108
taco 100
Organizations
Other Games
gamesdonequick3327
BasetradeTV25
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 60
• musti20045 35
• davetesta30
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• HerbMon 36
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21799
League of Legends
• Doublelift5016
Other Games
• imaqtpie1872
Upcoming Events
PiGosaur Cup
36m
WardiTV Invitational
11h 36m
The PondCast
1d 9h
OSC
1d 11h
OSC
2 days
All Star Teams
3 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
3 days
All Star Teams
4 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
4 days
OSC
4 days
[ Show More ]
Replay Cast
5 days
Wardi Open
5 days
Liquipedia Results

Completed

Proleague 2026-01-12
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
BLAST Bounty Winter Qual
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
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.