小编And*_*uiz的帖子

大文件不会在ASP.NET中上传

我有一个asp.net Web表单应用程序,我正在尝试使用FileUpload控件上传一个大型文件(13 MB),当我按下提交按钮时,Web浏览器开始上传文件.但是,当Web浏览器完成上传时,应用程序无故失败,并且不会出现任何异常,也不会输入提交按钮的单击事件代码(c#).在我的web.config中,我设置了maxAllowedContentLength选项和maxRequestLength选项.

<system.webServer>
<security>
 <requestFiltering>
    <requestLimits maxAllowedContentLength="52428800" />
  </requestFiltering>
</security>
Run Code Online (Sandbox Code Playgroud)

<httpRuntime targetFramework="4.5" executionTimeout="900" maxRequestLength="2097151" />
Run Code Online (Sandbox Code Playgroud)

这只发生在Web服务器(Windows Server 2012)中,在我的本地服务器中没有发生这种情况.在webserver中显示一个默认错误(我不管理服务器,所以我看不到发生了什么自定义错误)

我不知道为什么会这样,因为在网络服务器中,文件上传选项的应用程序更大.

谢谢你的帮助.

c# asp.net upload file

2
推荐指数
1
解决办法
4654
查看次数

标签 统计

asp.net ×1

c# ×1

file ×1

upload ×1