zoukankan      html  css  js  c++  java
  • asp .net 大文件传输配置

    asp .net config配置

    需要在配置文件里面设置文件上传限定的两个属性值:maxAllowedContentLength,maxRequestLength 允许上传文件的长度,和请求的长度,两个大小需要设置一致,如果不一致,则以请求长度为准。(设置的单位都为byte)
    默认请求长度只有4M.

    <system.web>
      <httpRuntime maxRequestLength="2147483647" executionTimeout="36000" delayNotificationTimeout="36000"/>
    </system.web>
    
    <system.webServer>
      <security>
        <requestFiltering>
          <!--<requestLimits maxAllowedContentLength="1073741824"/>-->
          <requestLimits maxAllowedContentLength="2147483648"/>
        </requestFiltering>
      </security>
    </system.webServer>
    

    服务器配置

    权限开放

    确保applicationhost.config中对该项修改的权限已经放开
    applicationhost.config文件路径在 C:WindowsSystem32inetsrvconfig 下
    将requestFiltering从"Deny"改为"Allow"

    <sectionGroup name="system.webServer">
      <sectionGroup name="security">
           <section name="requestFiltering" overrideModeDefault="Allow" />
      </sectionGroup>
    </sectionGroup>
    
    设置服务器级别的文件上传大小

    在applicationhost.config文件中加上以下字段

    <system.webServer>
       <security>
           <requestFiltering>
                  <requestLimits maxAllowedContentLength="2147483647" />
           </requestFiltering>
       <security>
    <system.webServer>
    

    可以通过命令行修改

    %windir%system32inetsrvappcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:2147483647
    

    参考资料

    Asp.net MVC 上传大文件(超过50M)的设置

  • 相关阅读:
    Ubuntu下的解压缩
    Android开机动画
    Android 5.0源码编译问题
    ubuntu学习的简单笔记
    全局变量:global与$GLOBALS的区别和使用
    Java语言中的面向对象特性总结
    c/c++常见面试题
    查数据库中的表,了解大体结构
    PHP数组详解
    HTML5新增及移除的元素
  • 原文地址:https://www.cnblogs.com/Lulus/p/9469732.html
Copyright © 2011-2022 走看看