当前位置:网站首页>.net core 访问不常见的静态文件类型(MIME 类型)
.net core 访问不常见的静态文件类型(MIME 类型)
2022-07-07 02:49:00 【平山CP3】
背景:需要在.net core网站中访问后缀为properties的文件,发现直接访问404,请教了同事后,发现需要配置一下.net core的支持访问静态文件的类型,记录一下
var provider = new FileExtensionContentTypeProvider();
// Add new mappings,将properties文件映射为text/html
provider.Mappings[".properties"] = "text/html";
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider
});
官方文档关于静态文件相关配置:
边栏推荐
猜你喜欢

Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données

Learning notes | data Xiaobai uses dataease to make a large data screen
![Stack and queue-p79-10 [2014 unified examination real question]](/img/7f/e5bba2f64bb77e1781076361c32f01.jpg)
Stack and queue-p79-10 [2014 unified examination real question]

Go straight to the 2022ecdc fluorite cloud Developer Conference: work with thousands of industries to accelerate intelligent upgrading

Several index utilization of joint index ABC

带你刷(牛客网)C语言百题(第一天)

联合索引ABC的几种索引利用情况

This article introduces you to the characteristics, purposes and basic function examples of static routing

JWT certification

FPGA课程:JESD204B的应用场景(干货分享)
随机推荐
Performance comparison between Ceres solver and g2o
Basic introduction of JWT
C interview encryption program: input plaintext by keyboard, convert it into ciphertext through encryption program and output it to the screen.
怎样查找某个外文期刊的文献?
Which foreign language periodicals are famous in geology?
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
MATLAB小技巧(29)多项式拟合 plotfit
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
【解决】Final app status- UNDEFINED, exitCode- 16
MySQL的安装
化工园区危化品企业安全风险智能化管控平台建设四大目标
一条慢SQL拖死整个系统
Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
精准时空行程流调系统—基于UWB超高精度定位系统
如何给目标机器人建模并仿真【数学/控制意义】
What books can greatly improve programming ideas and abilities?
数据资产管理与数据安全国内外最新趋势
Postgresql源码(60)事务系统总结
网络基础 —— 报头、封装和解包
偏执的非合格公司
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/static-files?view=aspnetcore-5.0