使用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錯誤。