[英]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.当我尝试显示我的图像时,我收到一个错误,我的扩展没有映射到 MIME 类型。 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.使用 Apache wamp 服务器我测试了所有图像并且可以显示它。
Then with IIS express included within visual studio 2017, is there a way to do the mapping.然后在visual studio 2017中包含IIS express,有没有办法进行映射。 I also did the mapping individually but this cannot be good solution for me because I have many images file.我也单独进行了映射,但这对我来说不是一个好的解决方案,因为我有很多图像文件。
You can change the config file that IIS express use it:您可以更改 IIS express 使用它的配置文件:
If you run iisexpress.exe from the command line, the config file it uses will be in AppServer/applicationhost.config
.如果您从命令行运行 iisexpress.exe,它使用的配置文件将在AppServer/applicationhost.config
。 Add the mime types you need to that file in the section <staticContent> and restart iisexpress.将您需要的 MIME 类型添加到 <staticContent> 部分中的该文件并重新启动 iisexpress。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.