IIS Directory Browsing won't show file contents

4.5k Views Asked by At

I set up two different computers the same way, as far as I can tell (each with it's own physical folder on the local hard drive), using the IIS UI. Both computers successfully display the list of files (some XML files) in its folder when browsed to. However, from one computer (1) you can click on a file name in the list, the browser will render the XML contents (indent, color, etc.). From the other computer (2), when you click the file name in the list, it simply displays a blank page.

I want the behavior for computer (1).

Another clue:

  • On computer (1), if you right-click and Save Target As, the Save As dialog will specify XML file in File Type.
  • On Computer (2), if you right-click and Save Target As, the Save As dialog will specify htm file in File Type.

Thanks!

Knom

1

There are 1 best solutions below

0
On BEST ANSWER

Never mind, I found out the answer as follows:

  • Find applicationHost.config file for the two computers in question, compare
  • The bad computer has no static content section
  • Use Control Panel, Programs and Features, Turn Windows features on or off, Internet Information Services -> World Wide Web Services -> Common HTTP Features -> Static Content check ON, OK
  • In IIS Manager, MIME Types, double check .xml is text/xml