解决 asp.net core 中下载 exe 文件返回 404

在 StartUp 中的 Configure 方法添加如下代码即可

app.UseStaticFiles(new StaticFileOptions()
{
ContentTypeProvider = new FileExtensionContentTypeProvider()
{
Mappings = {[".exe"] = "application/octect-stream"}
}
});

原因是默认没有 exe 的 content-type。

上一篇:【PMP】变更流程图与说明


下一篇:jquery 判断元素是否可见