在asp.net MVC中上传大文件时,出现HTTP错误404.13

编程入门 行业动态 更新时间:2024-10-19 23:24:38
本文介绍了在asp MVC中上传大文件时,出现HTTP错误404.13-未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望我的Web应用程序在服务器上上传大型zip文件.这是我的代码逻辑:

I want my web application to upload big zip file on the server. Here's my code logique :

@using (Html.BeginForm("AddApplication", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form" })) { <div class="form-group"> <span>PUT FILE HERE : <input style="min-width: 550px;" type="file" name="zippedApp" /></span> </div> }

反手C#代码:

[HttpPost] public ActionResult AddApplication( string description, HttpPostedFileBase zippedApp) { //code }

C#函数没有到达...甚至在进入我拥有的函数之前:

The C# function is not reached... before it even enters the function i have :

HTTP错误404.13-未找到

HTTP Error 404.13 - Not Found

所以我读了这篇文章:

IIS7-当请求参数的大小超过30mb时,Webrequest失败,并显示404.13

这让我感到没人真正知道答案.因为就我而言,我确定它与MVC web.Config有关.

And it makes me feel like no one really knows the answer. Because in my case i'm sure it is related to MVC web.Config.

我在我能找到的每一个配置中都添加了一堆<httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" />,但是还没有成功.

I added a bunch of <httpRuntime targetFramework="4.5.2" maxRequestLength="102400" executionTimeout="6000" /> in every pieces of config i could find... but no succes yet.

推荐答案

您还需要为IIS7 +添加它

You will also need to add this for IIS7+

<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="52428800" /> <!--50MB--> </requestFiltering> </security> </system.webServer>

更多推荐

在asp.net MVC中上传大文件时,出现HTTP错误404.13

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

发布评论

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

>www.elefans.com

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