自定义上传文件大小

    技术2022-05-11  124

    在ASP。NET中默认的上传文件大小不能超过4M.通过下面的二步,我们来自定义大小: (1)修改:Web.config。添加以下代码: <system.web>       <httpRuntime maxRequestLength="4096" executionTimeout="600">       </httpRuntime>  </system.web>  其中4096为文件的大小。单位为KB。600为上传文件有效时间,单位为秒。  (2)修改Machine.config。    在%/Microsoft.NET/Framework/v1.1.4322/CONFIG/machine.config中修改以下代码:    <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/>    修改90,和4096就好。    但是在ASP2.0中,没有这些代码。所以,在ASP2.0中只要第一步就好。    测试过。  

    最新回复(0)