Learn MS NET | How to serve files without extensions in IIS

Our journey learning how to write .NET

Learn MS NET

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

How to serve files without extensions in IIS


By default, IIS will not serve up files without an extension. Never the less sometimes we need to allow IIS to serve up these files.

The following web.config file can be placed in the directory that you want to serve up these files from.

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
         <system.webServer>
             <staticContent>
                 <clear />
                 <mimeMap fileExtension="." mimeType="*/*" />
             </staticContent>
         </system.webServer>
</configuration>

The mimeType can be adjusted to allow a specific type of file to be downloaded from the server as well.

Add comment

Loading