ASP.Net中上傳大檔案的解決辦法

來源:互聯網
上載者:User
在Web.config檔案中做如下的配置:
<configuration>
  <system.web>
    <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
  </system.web>
</configuration>

maxRequestLength就是上傳檔案的最大的位元組數,以 KB 為單位。預設值為 4096 KB (4 MB)。executionTimeout:指示在被 ASP.NET 自動關閉前,允許執行請求的最大秒數。
另外,上傳大檔案時,還可能會收到以下錯誤資訊:
aspnet_wp.exe (PID: 1520) 被回收,因為記憶體消耗超過了 460 MB(可用 RAM 的百分之 60)。
如果遇到此錯誤資訊,請增加應用程式的 Web.config 檔案的 元素中 memoryLimit 屬性的值。例如:
<configuration>
   <system.web>
      <processModel memoryLimit="80"/>
   </system.web>
</configuration>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.