Skip to main content
 首页 » 编程设计

c#之达到上传文件的最大长度

2024年02月13日16dflying

我有一个上传文件的asp.net应用程序:

@using (Html.BeginForm("Uploading_validation", "Akeo", FormMethod.Post, new { enctype = "multipart/form-data" })) 
{ 
    <input type="file" name="dossier" /> 
   <br /> 
 <input type="submit" value="OK" /> 
 } 

当我选择一个压缩文件上传时,出现Maximum request length exceeded. 异常,表明文件的长度高于最大长度。

如何将文件的长度更改为最大长度?这个最大值是多少?

请您参考如下方法:

<configuration> 
  <system.web> 
    <httpRuntime maxRequestLength="32768" /> 
  </system.web> 
</configuration> 

在这里阅读更多:http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx