HTTP上传大文件的注意点

使用HttpWebRequest上传大文件时,服务端配置中需要进行以下节点配置:

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxRequestLength="100000000" executionTimeout="600"></httpRuntime>
</system.web>
<system.webServer>
    <security>
      <requestFiltering>
        <!--这个节点直接决定了客户端文件上传最大值-->
        <requestLimits maxAllowedContentLength="2147483647" />
      </requestFiltering>
    </security>
  </system.webServer>

否则会出现服务端返回404错误。

posted @ 2015-10-24 13:40  小 天  阅读(1715)  评论(1编辑  收藏  举报