Click here to Skip to main content
15,887,944 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
C#
FileUpload1.PostedFile.ContentLength.ToString();
Or
C#
FileUpload1.FileContent.Length.ToString();

And thanks ahead
P.s it works with small file
Posted
Updated 18-Jan-14 15:47pm
v2
Comments
ZurdoDev 18-Jan-14 20:48pm    
What does "get stuck" mean? Do you have an error?
Tomasino.7 18-Jan-14 21:47pm    
yes it takes me to a conntetion stop page and btw it works with small file
ZurdoDev 18-Jan-14 21:50pm    
You should get a specific error. And google that error and you'll see that there is a setting in the web.config to allow larger file uploads. I don't recall the setting but if you google it you should find it. It's a common problem.

Refer - How to make the ASP File Upload control accept large files?[^]
Quote:
XML
<system.web>
  <httpruntime maxrequestlength="102400" executiontimeout="360" />
</system.web>

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.
 
Share this answer
 
Comments
Karthik_Mahalingam 18-Jan-14 22:24pm    
5!,
me too faced the same issue long back :)
this will help the OP for sure..
Thanks a lot Karthik. :)
XML
<system.web>
  <httpruntime maxrequestlength="102400" executiontimeout="360" />
</system.web>


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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900