2

I've got a php MVC website developed in Wamp as test server, which works perfectly fine in Chrome, Opera, Safari and FF. However, whenever I try to open it in IE or Edge, the html gets downloaded as a single file with a random name without extension.

I tried uploading it onto my shared hosting and still get the same issue, changing computers to access the page makes no difference neither.

I've got a feeling I need to declare something somewhere for IE and Edge but have no idea how to approach this... any advice would be appreciated!

UPDATE!!!! For whatever reason I had declared

header('Content-Type: charset=utf-8');

No idea why I declared that but removing this fixed the issue.

Thanks for your help!

Victor Nik
  • 77
  • 1
  • 7
  • 3
    It's a flaw in the mime types used in edge, [see related post](http://stackoverflow.com/questions/32829814/getting-microsoft-10-edge-browser-mime-types-php) – MiDri Nov 30 '15 at 16:11
  • Please share the response headers being sent to IE and Edge. Even better, if there is a resource online that demonstrates this, a link would be wonderful. – Sampson Nov 30 '15 at 16:42

2 Answers2

3

This appears to be an interoperability difference between Microsoft Edge and other browsers. From a cursory glance, I suspect the cause is a missing mime-type. Make sure that when you set the response headers, you state that the document is text/html.

After some additional testing, it appears as though Chrome and Firefox display the page as HTML while Safari displays the page as plain text. Both IE and Edge appear to download the file instead.

I'll file an issue to have the team evaluate Edge's behavior on grounds of interoperability.

Sampson
  • 265,109
  • 74
  • 539
  • 565
-2
<meta charset="utf-8"/>

notice the forward slash at the end. it helped me.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
dummy
  • 1
  • The `/` at the end has no effect unless you are writing XHTML, in which case the problem would be that the page would display an XML parsing error, not that the browser would download the file. – Quentin Mar 06 '17 at 07:49