• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:11
CEST 20:11
KST 03:11
  • 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 TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5TL.net Map Contest #21 - Finalists4Team TLMC #5: Vote to Decide Ladder Maps!0
Community News
5.0.15 Patch Balance Hotfix (2025-10-8)57Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition245.0.15 Balance Patch Notes (Live version)119$2,500 WardiTV TL Map Contest Tournament 154
StarCraft 2
General
5.0.15 Patch Balance Hotfix (2025-10-8) Classic Games #3: Rogue vs Serral at BlizzCon Geoff 'iNcontroL' Robinson has passed away Team TLMC #5: Winners Announced! 5.0.15 Balance Patch Notes (Live version)
Tourneys
SC2's Safe House 2 - October 18 & 19 RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Sparkling Tuna Cup - Weekly Open Tournament $2,500 WardiTV TL Map Contest Tournament 15
Strategy
Custom Maps
External Content
Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More Mutation # 491 Night Drive
Brood War
General
BW General Discussion Question regarding recent ASL Bisu vs Larva game Whose hotkey signature is this? Recent recommended BW games ASL20 General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL20] Ro8 Day 4 Small VOD Thread 2.0 [ASL20] Ro8 Day 3
Strategy
Current Meta TvZ Theorycraft - Improving on State of the Art Proposed Glossary of Strategic Uncertainty 9 hatch vs 10 hatch vs 12 hatch
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread Stop the Construction YouTube Thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts The Automated Ban List BarCraft in Tokyo Japan for ASL Season5 Final
Blogs
How "Not Like Us" ripped of…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2031 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
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
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
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
RotterdaM Event
17:15
Rotti Stream Rumble #5
RotterdaM820
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 820
IndyStarCraft 174
Livibee 90
BRAT_OK 70
MindelVK 29
gerald23 7
StarCraft: Brood War
GuemChi 3598
Shuttle 1119
Light 268
Hyuk 216
Hyun 163
Soulkey 142
Mong 86
Rush 85
Dewaltoss 80
Backho 41
[ Show more ]
soO 22
Yoon 21
Sacsri 13
Shine 10
SilentControl 6
Dota 2
Gorgc10049
qojqva2510
Counter-Strike
fl0m7314
Stewie2K15
Heroes of the Storm
Liquid`Hasu123
Other Games
FrodaN2336
Grubby484
Skadoodle149
KnowMe145
Sick131
C9.Mang0125
UpATreeSC55
Codebar39
Trikslyr38
Rex22
JuggernautJason12
Organizations
Other Games
BasetradeTV65
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Adnapsc2 9
• intothetv
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• 80smullet 25
• FirePhoenix12
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV478
League of Legends
• TFBlade808
Other Games
• imaqtpie852
• Shiphtur304
Upcoming Events
Korean StarCraft League
8h 49m
CranKy Ducklings
15h 49m
Map Test Tournament
16h 49m
OSC
20h 49m
[BSL 2025] Weekly
23h 49m
Safe House 2
23h 49m
Sparkling Tuna Cup
1d 15h
Map Test Tournament
1d 16h
OSC
1d 17h
IPSL
2 days
Bonyth vs Art_Of_Turtle
Razz vs rasowy
[ Show More ]
Afreeca Starleague
2 days
Barracks vs Snow
Afreeca Starleague
3 days
Soma vs Bisu
The PondCast
5 days
Liquipedia Results

Completed

Acropolis #4 - TS2
Maestros of the Game
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
WardiTV TLMC #15
EC S1
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
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 © 2025 TLnet. All Rights Reserved.