你好我有几个问题请进来 [英] Hello I Have A Few Questions Please Come On In

查看:88
本文介绍了你好我有几个问题请进来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我的网站遇到了一些问题:

1)我试图为所有错误设置错误页面,尽管它出现了什么样的错误......

2)我的网站上有一个fileupload控件,每当我尝试上传一个大文件时,当我请求文件的长度时它会卡住

hello , i have been having some problems with my website:
1) I am trying to set an error page for all the errors that could accour despite what kind of error it is ...
2) i have a fileupload control in my website and whenever i try to upload a large file it get stuck when i request the length of the file

FileUpload1.PostedFile.ContentLength.ToString();

FileUpload1.FileContent.Length.ToString();



并提前谢谢/>
Ps适用于小文件


And thanks ahead
P.s it works with small file

推荐答案

参考 - 如何使ASP文件上传控件接受大文件? [ ^ ]

Refer - How to make the ASP File Upload control accept large files?[^]
Quote:

<system.web>
  <httpruntime maxrequestlength="102400" executiontimeout="360" />
</system.web>



这就是你要找的东西。更改web.config文件中的executionTimeout属性。



根据这个网站 [ ^ ],


This is what you are looking for. Change the executionTimeout property in web.config file.

According to this website[^],

引用:



maxRequestLength - 属性限制ASP.NET应用程序的文件上载大小。此限制可用于防止用户将大文件发布到服务器导致的拒绝服务攻击(DOS)。指定的大小以千字节为单位。如前所述,默认值为4096(4 MB)。 .NET Framework 1.0 / 1.1的最大值为1048576(1 GB),.NET Framework 2.0的最大值为2097151(2 GB)。



executionTimeout - 属性指示在应用程序自动关闭之前允许执行请求的最大秒数。 executionTimeout值应始终长于上载过程可以花费的时间。


maxRequestLength - Attribute limits the file upload size for ASP.NET application. This limit can be used to prevent denial of service attacks (DOS) caused by users posting large files to the server. The size specified is in kilobytes. As mentioned earlier, the default is "4096" (4 MB). Max value is "1048576" (1 GB) for .NET Framework 1.0/1.1 and "2097151" (2 GB) for .NET Framework 2.0.

executionTimeout - Attribute indicates the maximum number of seconds that a request is allowed to execute before being automatically shut down by the application. The executionTimeout value should always be longer than the amount of time that the upload process can take.


<system.web>
  <httpruntime maxrequestlength="102400" executiontimeout="360" />
</system.web>





这就是你要找的东西。更改web.config文件中的executionTimeout属性。



根据这个网站[^],

引用:

maxRequestLength - 属性限制ASP.NET应用程序的文件上载大小。此限制可用于防止用户将大文件发布到服务器导致的拒绝服务攻击(DOS)。指定的大小以千字节为单位。如前所述,默认值为4096(4 MB)。 .NET Framework 1.0 / 1.1的最大值为1048576(1 GB),.NET Framework 2.0的最大值为2097151(2 GB)。



executionTimeout - 属性表示在应用程序自动关闭之前允许执行请求的最大秒数。 executionTimeout值应始终长于上载过程可以花费的时间。



This is what you are looking for. Change the executionTimeout property in web.config file.

According to this website[^],
Quote:
maxRequestLength - Attribute limits the file upload size for ASP.NET application. This limit can be used to prevent denial of service attacks (DOS) caused by users posting large files to the server. The size specified is in kilobytes. As mentioned earlier, the default is "4096" (4 MB). Max value is "1048576" (1 GB) for .NET Framework 1.0/1.1 and "2097151" (2 GB) for .NET Framework 2.0.

executionTimeout - Attribute indicates the maximum number of seconds that a request is allowed to execute before being automatically shut down by the application. The executionTimeout value should always be longer than the amount of time that the upload process can take.


这篇关于你好我有几个问题请进来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆