gpt4 book ai didi

.net - 使用.net core 2.1和Azure上传大文件

转载 作者:行者123 更新时间:2023-12-02 08:01:54 24 4
gpt4 key购买 nike

请您帮忙解决下一个问题:

无法将大文件(~200 MB)上传到网站。使用.net core 2.1项目和Azure blob。所以发现我应该设置

<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="100000"/>
</system.web>

<requestLimits maxAllowedContentLength="1073741824" />

在web.config中,但无法设置,所以发现我可以在applicationhost.config中进行

之后,在本地计算机上工作,但将项目部署到 Azure 时失败并显示错误:“您要查找的资源已被删除、更名或暂时不可用。”

您能告诉我可能出现什么问题吗?我应该在 Azure 中设置任何内容来上传大文件吗?或者如何正确设置 web.config(我在我的项目中找不到它)?

谢谢!

最佳答案

Or how correct setup web.config(i can't find it in my project)?

当您将.net core项目部署到Azure时,您可以转到https://xxxxx.scm.azurewebsites.net并单击调试控制台> CMD > site > wwwroot > web.configweb.config 将在那里。然后您可以将请求限制增加到 200MB,如下所示:

<system.webServer>
<security>
<requestFiltering>
<!-- 100 MB in bytes -->
<requestLimits maxAllowedContentLength="209715200" />
</requestFiltering>
</security>
</system.webServer>

这是一个类似的issue你可以引用一下。

关于.net - 使用.net core 2.1和Azure上传大文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54484169/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com