Windows Vista Tips

Windows Vista Tips > Newsgroups > Internet Explorer > IE7 changes image MIME type

Reply
Thread Tools Display Modes

IE7 changes image MIME type

 
 
Ildhund
Guest
Posts: n/a

 
      11-28-2009
Trying to upload a PNG or JPG image to a website fails. IE7 has changed the
MIME types from image/jpeg to image/pjpeg and image/png to image/x-png,
neither of which is accepted by the site.
(a) Why does IE do this?
(b) Can I stop it from doing this?

I read at

http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx

When uploading files from the client to the Web server, Windows Internet
Explorer uses FindMimeFromData to determine a MIME type. Where possible,
FindMimeFromData returns hard-coded values from the list of Known MIME Types
rather than relying on the MIME type value associated with the file extension
in the system registry. 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


but I'm none the wiser.

--
Noel

[Also posted at answers.live.com - just to compare the performance of the
two sites]
 
Reply With Quote
 
 
 
 
Robert Aldwinckle
Guest
Posts: n/a

 
      11-28-2009

"Ildhund" <> wrote in message news:9B488B52-E1FE-43EB-AE4C-...
> Trying to upload a PNG or JPG image to a website fails. IE7 has changed the
> MIME types from image/jpeg to image/pjpeg and image/png to image/x-png,
> neither of which is accepted by the site.


> (a) Why does IE do this?



Supposedly it is part of MIME sniffing.


> (b) Can I stop it from doing this?



Disable it using the Security settings option

( Disable ) Open files based on content, not file extension

(Tip: it's in Miscellaneous section, so press M and O to find it.)


HTH

Robert
---


>
> I read at
>
> http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx
>
> When uploading files from the client to the Web server, Windows Internet
> Explorer uses FindMimeFromData to determine a MIME type. Where possible,
> FindMimeFromData returns hard-coded values from the list of Known MIME Types
> rather than relying on the MIME type value associated with the file extension
> in the system registry. 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
>
>
> but I'm none the wiser.
>
> --
> Noel
>
> [Also posted at answers.live.com - just to compare the performance of the
> two sites]



 
Reply With Quote
 
Ildhund
Guest
Posts: n/a

 
      11-28-2009
"Robert Aldwinckle" wrote:
> "Ildhund" <> wrote...
> > Trying to upload a PNG or JPG image to a website fails. IE7 has changed the MIME types from image/jpeg to image/pjpeg and image/png to image/x-png, neither of which is accepted by the site.

>
> > (a) Why does IE do this?

>
> Supposedly it is part of MIME sniffing.
>
> > (b) Can I stop it from doing this?

>
> Disable it using the Security settings option
>
> ( Disable ) Open files based on content, not file extension
>
> (Tip: it's in Miscellaneous section, so press M and O to find it.)


Thank you, Robert, but no joy, I'm afraid. I had that setting to start with;
I changed it, re-started IE7, changed it back and re-started again. Then I
tried an upload, and this is what Fiddler says I'm posting:

Content-Disposition: form-data; name="Filedata";
filename="G:\Documents\Noel\My Pictures\Screenshot.PNG"
Content-Type: image/x-png

and the site responds with

[The content type of this image is not allowed.]

so that setting seems not to affect outgoing traffic.
--
Noel
 
Reply With Quote
 
Robert Aldwinckle
Guest
Posts: n/a

 
      11-29-2009

"Ildhund" <> wrote in message news:F1840B43-7FA0-4BB0-A7E0-...
> "Robert Aldwinckle" wrote:
>> "Ildhund" <> wrote...
>> > Trying to upload a PNG or JPG image to a website fails.
>>> IE7 has changed the MIME types from image/jpeg to image/pjpeg
>>> and image/png to image/x-png, neither of which is accepted by the site.

>>
>> > (a) Why does IE do this?

>>
>> Supposedly it is part of MIME sniffing.
>>
>> > (b) Can I stop it from doing this?

>>
>> Disable it using the Security settings option
>>
>> ( Disable ) Open files based on content, not file extension
>>
>> (Tip: it's in Miscellaneous section, so press M and O to find it.)

>
> Thank you, Robert, but no joy, I'm afraid. I had that setting to start with;
> I changed it, re-started IE7, changed it back and re-started again. Then I
> tried an upload, and this is what Fiddler says I'm posting:
>
> Content-Disposition: form-data; name="Filedata";
> filename="G:\Documents\Noel\My Pictures\Screenshot.PNG"
> Content-Type: image/x-png
>
> and the site responds with
>
> [The content type of this image is not allowed.]
>


> so that setting seems not to affect outgoing traffic.
> --
> Noel



Sorry, Noel. I had completely overlooked that this is an upload scenario.
You're right; I wouldn't expect that option to affect that case.

Now my only suggestion would be to try using ProcMon, for Registry
accesses, hoping that that could give you a clue to a possible
HKCU override you could devise and use.


Good luck

Robert
---


 
Reply With Quote
 
Ildhund
Guest
Posts: n/a

 
      12-01-2009
"Robert Aldwinckle" wrote:
> "Ildhund" wrote...
> > "Robert Aldwinckle" wrote:
> >> "Ildhund" <> wrote...
> >> > Trying to upload a PNG or JPG image to a website fails.
> >>> IE7 has changed the MIME types from image/jpeg to image/pjpeg
> >>> and image/png to image/x-png, neither of which is accepted by the site.
> >>
> >> > (a) Why does IE do this?
> >>
> >> Supposedly it is part of MIME sniffing.
> >>
> >> > (b) Can I stop it from doing this?
> >>
> >> Disable it using the Security settings option
> >>
> >> ( Disable ) Open files based on content, not file extension
> >>
> >> (Tip: it's in Miscellaneous section, so press M and O to find it.)

> >
> > Thank you, Robert, but no joy, I'm afraid. I had that setting to start with;
> > I changed it, re-started IE7, changed it back and re-started again. Then I
> > tried an upload, and this is what Fiddler says I'm posting:
> >
> > Content-Disposition: form-data; name="Filedata";
> > filename="G:\Documents\Noel\My Pictures\Screenshot.PNG"
> > Content-Type: image/x-png
> >
> > and the site responds with
> >
> > [The content type of this image is not allowed.]
> >

>
> > so that setting seems not to affect outgoing traffic.


> Sorry, Noel. I had completely overlooked that this is an upload scenario.
> You're right; I wouldn't expect that option to affect that case.
>
> Now my only suggestion would be to try using ProcMon, for Registry accesses, hoping that that could give you a clue to a possible HKCU override you could devise and use.


It looks as if the conversion is hard-wired into urlmon.dll. In the
meantime, the question has become a trifle academic: those responsible for
the forum concerned have tweaked their upload procedure to allow both
image/pjpeg and image/x-png. It's still extremely annoying, though, and there
must be many sites where this arbitrary interference by IE causes problems.

Thanks as always for your interest.
--
Noel
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MUI Problem elakhna Windows Vista Installation 3 12-04-2007 10:39 AM
Easy Transfer Error Message Jim Windows Vista Installation 11 09-22-2007 07:23 AM
BSoD at Windows Vista during shutdown/restart! PLEASE HELP! g33k Windows Vista Performance 4 07-26-2007 04:19 PM
Setting up the Coldfusion document type in MIME mapping on IIS 7.0 Beta iam bennu Windows Vista Installation 1 07-05-2006 07:45 PM
Stop Error 0x0000007b Louis LeBrun Windows Vista Installation 17 07-05-2006 09:00 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59