Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: ocean10000

Message Too Old, No Replies

Content Type on IIS7.5

On IE it prompt to download file

     
1:57 pm on May 9, 2012 (gmt 0)

Full Member

5+ Year Member

joined:June 24, 2008
posts: 219
votes: 0


Hello

When i try to add Content-Type to IIS 7.5 to look like this:

Content-Type => text/html, charset=utf-8

It work fine with F, but IE will prompt to download the file!

Any idea why?

I also noticed some servers respond with a header showing:
Content-Type => text/html; charset=utf-8

While in my case semi colon is replaced with , like this

Content-Type => text/html, charset=utf-8

This is normal with IIS7.5?

Thanks in advance
2:05 pm on May 9, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:852
votes: 0


"text/html; charset=utf-8" is the correct form to use.

IE doesn't couldn't find a match on how to render "text/html, charset=utf-8" so it asks for you to download it.

I am assuming Firefox just ignores what it doesn't understand, or has a code path that handles this case.

When you added the content type you more then likely added it with a "," instead of ";"
2:16 pm on May 9, 2012 (gmt 0)

Full Member

5+ Year Member

joined:June 24, 2008
posts: 219
votes: 0


Hello Ocean10000

This is a fast useful response.

In fact I just add the content name and type via IIS7.5 IU.

and IIS produce the , with no control from my side!

Any idea why or how to fix it?

seems like i need to search for how to replace , with ; for IIS, since searching the problem the way i described in the post lead to no results!

Many thanks
3:30 pm on May 9, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:852
votes: 0


Here is a little quick walk though I found on Microsoft Technet, on how to edit MIME Types.

Edit a MIME Type (IIS 7) [technet.microsoft.com]
3:39 pm on May 9, 2012 (gmt 0)

Full Member

5+ Year Member

joined:June 24, 2008
posts: 219
votes: 0


thanks again ocean,

In fact i thought of mime type, since i found no .php (my root document file) mime type.

I asked my host, they said php isn't handled by mimetype, its handled via handlers, and is added to be handled via fastcgi in our case.

I also made a try, added .php mimetype as text/html and nothing changed!

I spent hours searching the web, just one post talking about it on IIS forum with no resolution.

I replied back to host (who consider this outside their support scope) to see if they can help, they usually do if they have the info.

Will update this post with any new findings!

Thanks again
12:28 am on May 12, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Nov 20, 2007
posts: 585
votes: 0


I get this when I havenít yet mapped the php on the website. On the IIS manager, right click on the website, > home directory > configuration > add the php.exe to the .php.

If they are providing php, then this is their issue.
2:38 pm on May 12, 2012 (gmt 0)

Full Member

5+ Year Member

joined:June 24, 2008
posts: 219
votes: 0


Hello Seb7

What configuration you mean? Im using IIS 7.5

In fact php is loaded and working without issues!