, :
app.UseStaticFiles(new StaticFileOptions
{
ServeUnknownFileTypes = true, //allow unkown file types also to be served
DefaultContentType = "Whatver you want eg: plain/text" //content type to returned if fileType is not known.
}
StaticFileMiddleware
, , .
FileExtensionContentTypeProvider
, ContentType Http Response. exe
.
, , Exe :
var provider = new FileExtensionContentTypeProvider();
provider.Mappings.Add(".exe", "application/vnd.microsoft.portable-executable");
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider
});