虽然上传大文件得到错误

编程入门 行业动态 更新时间:2024-10-24 02:36:28
本文介绍了虽然上传大文件得到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用.NET 4.5。我设置的配置文件为100 MB的最大请求长度和 maxAllowedContentLength 。当我尝试上载大于100 MB的文件(如200MB到1000MB)我得到一个错误

I am using 4.5. I set maximum request length and maxAllowedContentLength in config file as 100 mb. When I try to upload larger than 100 mb file (like 200mb to 1000mb) I am getting an error

The request filtering module is configured to deny a request that exceeds the request content length

这是正常的,预期的错误,但是当我尝试大于1 GB,我得到错误Internet Explorer无法显示网页。

This is normal and expected error but when I try to larger than 1 gb, I am getting error "internet explorer cannot display page".

我认为这是由于超时问题,但我真的无法弄清楚这个错误的实际原因。

I think it is due to a timeout issue but I really can't figure out actual reason of this error.

感谢ü。

推荐答案

这已经被问在计算器上许多倍。我会继续的传统:)对于较大的上载,你需要设置两个参数:

This has been asked about on StackOverflow many times. I'll continue the tradition :) For large uploads you need to set two parameters:

  • maxAllowedContentLength 的为字节测量,所以确保你实际上已经正确设置。要允许上传1GB,它应该是134217728。

  • maxAllowedContentLength is measured in bytes, so make sure you've actually set it correctly. To allow 1GB uploads, it should be 134217728.

您还需要配置 的maxRequestLength 的以及maxAllowedContentLength。但是请注意,这是的以KB为单位测,所以这将是不同的。

You also need to configure maxRequestLength as well as maxAllowedContentLength. Note though that it is measured in kilobytes, so it will be different.

例如:

<configuration> <system.web> <httpRuntime maxRequestLength="1048576" /> </system.web> </configuration> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="1073741824" /> </requestFiltering> </security> </system.webServer>

更多推荐

虽然上传大文件得到错误

本文发布于:2023-11-01 12:28:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549332.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:大文件   错误   上传

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!