当前位置: 移动技术网 > IT编程>开发语言>.net > 解决 asp.net core 中下载 exe 文件返回 404

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

2018年08月26日  | 移动技术网IT编程  | 我要评论

卫浴玻璃,gba皇家骑士团,杨百万博客

在 startup 中的 configure 方法添加如下代码即可

app.usestaticfiles(new staticfileoptions()
{
    contenttypeprovider = new fileextensioncontenttypeprovider()
    {
        mappings = {[".exe"] = "application/octect-stream"}
    }
});

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网