By default, ASP.NET only permits files that are 4,096 kilobytes (KB) (or 4 MB) or less to be uploaded to the Web server. To upload larger files, you must change the maxRequestLength parameter of the <httpRuntime> section in the Web.config file.If you want to change this setting for all of the computer and not just this ASP.NET application, you must modify the Machine.config file.By default, the <httpRuntime> element is set to the following parameters in the Machine.config file: <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" /> The Machine.config file is located in the C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG directory. 你可以在Machine.config 中以本机所有的上传做一个限制。也可以如楼上所说对某一个就用程序中用web.config对程序进行限制。
<httpRuntime
executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>
The Machine.config file is located in the C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG directory.
你可以在Machine.config 中以本机所有的上传做一个限制。也可以如楼上所说对某一个就用程序中用web.config对程序进行限制。