举个例子ExsClass.UpLoad(Request.Files["File"].InputStream);ExsClass.UpLoad是我的一个方法,只有一个参数,类型自然为System.IO.Stream请问,这样做了之后,在ExsClass.UpLoad里执行一切的时候Request.Files["File"].InputStream的数据是否已经全部传递到服务器的内存里了?
解决方案 »
- asp.net mvc handleError
- js 如何双击button 触发file click 事件,解决问题,点数全送
- 求一个javascript编辑器?如同vs2005那样点后带自动提示!
- @@关于在C#中动态生成excel图表问题?
- 怎么看文件的类型
- |1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20所有这些字符串,我要把它的数字一个个剥离,怎么操作
- 关于分页的问题,搜索结果后的分页
- 如何像登陆csdn社区那样保存密码。
- vss的问题,请大家帮忙
- 在ASP.NET安装部署中,如何判断是否安装SQL2000,否则就提示无法安装??
- 如何把一个文件从服务器端写到客户端?
- IE5.0以上可用全部事件列表详细资料哪里能找到,我找了很久都是些IE4.0的事件列表
var sFile = document.all("AttachFile").value;
if (sFile =="")
{
alert("文件名为空!");
return false;
}
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFile(sFile);
var sSize = document.all("tbmaxRequestLength").value;
var iSize = 0;
iSize = parseInt(sSize) * 1024;
if (isNaN(iSize))
{
alert("允许上传的文件大小错误!");
return false;
}
//alert(iSize);
//alert("文件:"+ sFile +"\n大小:"+f.Size);
if (f.size > iSize)
{
alert("要上传的文件太大,服务器不允许上传!");
return false;
}
MSDN Home > MSDN Library > .NET Development > .NET Framework SDK > .NET Framework > Reference > Configuration File Schema > ASP.NET Settings Schema
.NET Framework General Reference <httpRuntime> Element
Configures ASP.NET HTTP runtime settings. This section can be declared at the machine, site, application, and subdirectory levels.<configuration>
<system.web>
<httpRuntime><httpRuntime useFullyQualifiedRedirectUrl="true|false"
maxRequestLength="size in kbytes"
executionTimeout="seconds"
minFreeThreads="number of threads"
minFreeLocalRequestFreeThreads="number of threads"
appRequestQueueLimit="number of requests"
versionHeader="version string"/>
Optional Attributes
Attribute Option Description
appRequestQueueLimit The maximum number of requests that ASP.NET will queue for the application. When there are not enough free threads to process a request, the requests are queued. Incoming requests will be rejected with a "503 - Server Too Busy" error when the queue exceeds the limit specified in this setting.
executionTimeout Indicates the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.
enable Specifies whether the App Domain is enabled. at the current node and at the child node level. The default value is true.
true Specifies that the App Domain be enabled.
false Specifies that the App Domain be disabled. The application is not loaded in memory and any client request will cause a 404 error to be issued.
idleTimeOut Specifies the App Domain idle time before it is shut down. The default value is 20 minutes.
enableKernelModeCache Specifies whether output caching is enabled. At this time, this attribute is only relevant when IIS version 6.0 or later is installed. The output caching configuration and type of request determines whether content can be cached.
In order to cache a response, the following criteria need to be met: Caching must be explicitly enabled by a page directive or by the use of the caching API.
Caching must have an expiration policy so that the kernel knows when to discard it.
Caching cannot have any variable headers or parameters.
The request must not require any authentication.
true Specifies that caching be enabled.
false Specifies that caching be disabled.
maxRequestLength Indicates the maximum file upload size supported by ASP.NET. This limit can be used to prevent denial of service attacks caused by users posting large files to the server. The size specified is in kilobytes. The default is 4096 KB (4 MB).
minFreeLocalRequestFreeThreads The minimum number of free threads that ASP.NET keeps available to allow execution of new local requests. This number of threads is kept reserved for requests coming from the local host, in case some requests issue child requests to the local host during their processing. This avoids a possible deadlock with recursive reentry into the Web server.
minFreeThreads The minimum number of free threads to allow execution of new requests. ASP.NET keeps this many threads free for requests that require additional threads to complete their processing.
useFullyQualifiedRedirectUrl Indicates whether client-side redirects are fully qualified (in {HYPERLINK "http://server/path" } form, which is necessary for some mobile controls) or whether relative redirects are instead sent to the client.
true Specifies that client-side redirects need to be sent fully qualified. This is achieved by automatically converting all redirects that are not fully qualified to fully qualified form.
false Specifies that client-side redirects do not need to be automatically converted to the fully qualified form. false is the default.
versionHeader Specifies the value of a version header that ASP.NET sends with every response. This attribute is used by Microsoft Visual Studio .NET to determine which version of ASP.NET is in use. It is not necessary for production sites and can be disabled either by removing the attribute from Web.config or Machine.config, or setting the attribute to an empty string (versionHeader=""). Example
The following example specifies HTTP runtime parameters for an ASP.NET application.<configuration>
<system.web>
<httpRuntime maxRequestLength="4000"
useFullyQualifiedRedirectUrl="true"
executionTimeout="45"
versionHeader="1.1.4128"/>
</system.web>
</configuration>
Requirements
Contained Within: <system.web>Web Platform: IIS 5.0, IIS 5.1, IIS 6.0Configuration File: Machine.config, Web.configConfiguration Section Handler: System.Web.Configuration.HttpRuntimeConfigurationHandlerSee Also
ASP.NET Configuration | ASP.NET Settings Schema | Caching ASP.NET Pages
Contact Us | E-Mail this Page | MSDN Flash Newsletter
© 2004 Microsoft Corporation. All rights reserved. Terms of Use Privacy Statement Accessibility
<configuration>
<system.web>
<httpRuntime maxRequestLength="40000"/>
</system.web>
</configuration>在此之前,没有“ <httpRuntime maxRequestLength="40000"/> ”的配置文件,上传6M的这个文件要出问题。