asp.net mvc Post上傳文件大小限制


 最近發現在項目中使用jQuery.form插件上傳比較大的文件時,上傳不了,於是改了下web.config的上傳文件最大限制。

<configuration>  
    <system.web>  
        <httpRuntime maxRequestLength="102400" executionTimeout="200" enable="true" />
    </system.web>  
</configuration>

 改完后還是不能上傳,最后在stackoverflow找到了答案,原來還要配置服務端的最大文件限制。

譬如限制最大文件為100M

<configuration>  
    <system.web>  
        <httpRuntime maxRequestLength="102400" executionTimeout="200" enable="true" />
    </system.web>  
</configuration>
<system.webServer>  
   <security>  
      <requestFiltering>  
         <requestLimits maxAllowedContentLength="104857600" />  
      </requestFiltering>  
   </security>  
 </system.webServer> 

 

 

stackoverflow答案地址:http://stackoverflow.com/questions/23327338/maxrequestlength-for-net-4-5-1-framework


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM