Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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
v4
Comments
Frank R. Haugen 4-Mar-14 18:12pm    
You should tag this as ASP and/or Web-related

Have you tried using something else than "file length"?

And, I haven't any experience with ASP, but in doesn't C# for ASP come with an exception "handler", so you can print to screen the exeption-"string"?
ZurdoDev 4-Mar-14 20:11pm    
1. Where are you stuck?
2. What does get stuck mean?
3. This is 2 questions, you should really have posted 2 separate questions.

You need to set up the web.config file to allow large files.

See - Setting up Web.config to allow uploading of large files by ASP .NET applications[^].
 
Share this answer
 
Modify the maxAllowedContentLength setting in the web.config like,
HTML
<system.webserver>
  <security>
    <requestfiltering>
      <requestlimits maxallowedcontentlength="2147483648" />
    </requestfiltering>
  </security>
</system.webserver>

You can read this as well : http://blogs.msdn.com/b/prashant_upadhyay/archive/2011/07/13/large-file-upload-issue-in-asp-net.aspx[^]

-KR
 
Share this answer
 
Comments
Pranav-BiTwiser 5-Mar-14 0:22am    
I want to upload the file into the database through webservice, but the problem is it can't upload more than 90 mb.....any solution??

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