当前位置:网站首页>.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
});
官方文档关于静态文件相关配置:
边栏推荐
猜你喜欢

JWT的基础介绍

「运维有小邓」符合GDPR的合规要求

多个kubernetes集群如何实现共享同一个存储

Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition

Prompt for channel security on the super-v / device defender side when installing vmmare

A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are

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

Abnova 免疫组化服务解决方案

使用TCP/IP四层模型进行网络传输的基本流程

品牌电商如何逆势增长?在这里预见未来!
随机推荐
What books can greatly improve programming ideas and abilities?
docker-compose启动redis集群
Prompt for channel security on the super-v / device defender side when installing vmmare
Learning notes | data Xiaobai uses dataease to make a large data screen
jdbc数据库连接池使用问题
程序员的日常 | 每日趣闻
怎样查找某个外文期刊的文献?
MOS管参数μCox得到的一种方法
Linear algebra (1)
MySQL installation
2022 Android interview essential knowledge points, a comprehensive summary
2022/07/04学习记录
Jetpack Compose 远不止是一个UI框架这么简单~
大咖云集|NextArch基金会云开发Meetup来啦
【mysqld】Can't create/write to file
Data of all class a scenic spots in China in 2022 (13604)
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
地质学类比较有名的外文期刊有哪些?
关于数据库数据转移的问题,求各位解答下
JWT 认证
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/static-files?view=aspnetcore-5.0