Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to configure static file mimetypes in a Blazor WebApp 8

$
0
0

In a Blazor Server Side .net 7 app if you need to handle some particular static files types (eg. a outlook .msg or something that would be treated as application/octet-stream) you have to configure it in program.cs like this

builder.Services.PostConfigure<StaticFileOptions>(o =>{    ((FileExtensionContentTypeProvider)o.ContentTypeProvider).Mappings[".msg"] = "application/vnd.ms-outlook";});

Unfortunately, this doesn't work anymore in .NET 8, it is confirmed by design, but I cannot figure out how to fix...

Any help?

Thanks


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>