Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow IIS express to access any file extensio

Tags:

iis

mime

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.

like image 713
Valimo Ral Avatar asked May 09 '17 11:05

Valimo Ral


2 Answers

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

like image 68
Mohammad Reza Rahimi Avatar answered Oct 05 '22 04:10

Mohammad Reza Rahimi


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.

like image 34
John Henckel Avatar answered Oct 05 '22 05:10

John Henckel