boykely
boykely

Reputation: 381

How to allow IIS express to access any file extensio

I have multiple images but i have changed the extension for my own purpose. So I have multiple extension. When I try to display my image I got an error that my extension is not mapped to a mime type. So how can I display my image without changing the extension because I have a lot. With Apache wamp server I tested all images and it can be displayed.

Then with IIS express included within visual studio 2017, is there a way to do the mapping. I also did the mapping individually but this cannot be good solution for me because I have many images file.

Upvotes: 5

Views: 2894

Answers (2)

John Henckel
John Henckel

Reputation: 11347

If you run iisexpress.exe from the command line, the config file it uses will be in AppServer/applicationhost.config. Add the mime types you need to that file in the section <staticContent> and restart iisexpress.

Upvotes: 1

Mohammad Reza Rahimi
Mohammad Reza Rahimi

Reputation: 662

You can change the config file that IIS express use it:

  1. Right click on IIS Express icon on traybar then click on "Show All Application"

open config file

  1. Select your application name and click on config address in bottom of application list.

open config file

  1. Opened file contains xml elements. you must find "staticConten" element then add your intended mapping.

enter image description here

Upvotes: 11

Related Questions