增加 ASP.NET 站点的executionTimeout 和maxRequestLength 是否有任何危险?
我有一位用户尝试使用 ASP.NET 站点上传 150 MB 的文件。他们收到 HttpException:
System.Web.HttpException:超出最大请求长度。
我相信我可以通过将executionTimeout 增加到 300 秒(5 分钟)并将 maxRequestLength 增加到 204800 KB(200 兆字节)来解决此问题。但这样做是否有任何潜在的负面影响或危险?
I have a user who is trying to upload a 150 megabyte file using an ASP.NET site. They are getting an HttpException:
System.Web.HttpException: Maximum request length exceeded.
I believe I can solve this by increasing the executionTimeout to 300 seconds (5 minutes) and maxRequestLength to 204800 kilobytes (200 megabytes). But are there any potential negative effects or dangers from doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议只为需要它们的页面而不是整个网站设置较大的值;两者都可以通过编程方式为页面设置。否则,我没有看到超时和文件大小增加的问题。您可能应该添加一个警告,说明上传可能需要长达 5 分钟的时间,这样用户就不会一直点击按钮(即:ajax 进度条)。
System.Web.Configuration.HttpRuntimeSection.MaxRequestLength 和 Server.ScriptTimeout
I would recommend only setting those larger values for the page that needs them rather than the site as a whole; both can be set programmatically for the page. Otherwise, I don't see a problem with the increased timeout and file size. You should probably include a warning that the upload could take up to 5 minutes so users don't keep hitting buttons (ie: ajax progress bar).
System.Web.Configuration.HttpRuntimeSection.MaxRequestLength and Server.ScriptTimeout