当前位置:网站首页>.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
});
官方文档关于静态文件相关配置:
边栏推荐
- Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
- 【解决】Final app status- UNDEFINED, exitCode- 16
- How to find the literature of a foreign language journal?
- 肿瘤免疫治疗研究丨ProSci LAG3抗体解决方案
- LM11丨重构K线构建择时交易策略
- Jmeter 5.5版本发布说明
- 大促过后,销量与流量兼具,是否真的高枕无忧?
- 分布式id解决方案
- SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
- 企業如何進行數據治理?分享數據治理4個方面的經驗總結
猜你喜欢

LM11丨重构K线构建择时交易策略

JWT 认证
![Stack and queue-p79-10 [2014 unified examination real question]](/img/7f/e5bba2f64bb77e1781076361c32f01.jpg)
Stack and queue-p79-10 [2014 unified examination real question]

MySQL的主从复制原理

SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
![Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]](/img/13/096857158c9f977f8677f7cd0f9d4b.png)
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]

Learning notes | data Xiaobai uses dataease to make a large data screen

MOS管参数μCox得到的一种方法

程序员的日常 | 每日趣闻
![[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)](/img/77/bd80ed602208be6a9ef8be60c6ad06.png)
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
随机推荐
中英文说明书丨ProSci LAG-3 重组蛋白
impdp的transform参数的测试
Distributed ID solution
Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
How can I check the DOI number of a foreign document?
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
Basic introduction of JWT
Redis (I) -- getting to know redis for the first time
Take you to brush (niuke.com) C language hundred questions (the first day)
地质学类比较有名的外文期刊有哪些?
Google Chrome browser released patch 103.0.5060.114 to fix the 0-day vulnerability
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
大促过后,销量与流量兼具,是否真的高枕无忧?
LM11丨重构K线构建择时交易策略
化工园区危化品企业安全风险智能化管控平台建设四大目标
7天零基础能考证HCIA吗?华为认证系统学习路线分享
JWT的基础介绍
Several index utilization of joint index ABC
Programmers' daily | daily anecdotes
Stack and queue-p79-10 [2014 unified examination real question]
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/static-files?view=aspnetcore-5.0