473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reg uploading huge files.

hi friends,
I am developing ASP.NET application which allows user to upload the
files upto 10 MB.
But if the user selects the file to upload more than 10 MB the
application crashes with error.
I have tried the follwoing to prevent the crash.

if (System.IO.Path.GetFileName(Request.Path).ToLower( ) ==
"default.aspx")
{
System.Exception appException = Server.GetLastError();
HttpException chkException = (HttpException) appException;
if ((chkException.GetHttpCode() == 500 ||
chkException.GetHttpCode() == 400) && chkException.ErrorCode ==
-2147467259)
{
Session.Add("ImageTooLarge",true);
Server.ClearError();
Response.Redirect("Default.aspx");
}

}

But it didnt help me.
Also I have used Custom errors

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="400" redirect="UploadError.htm" />
<error statusCode="500" redirect="UploadError.htm" />
</customErrors>

This also not helped me from that error.

Friends please help me what to do..
Thanks and regards,
Muthu Kumaran.D

Apr 24 '07 #1
1 1097
Try setting

<httpRuntime maxRequestLength="12000" />
in the web.config file. The size is in kbytes.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"muthu" <mu***************@gmail.comwrote in message
news:11**********************@o40g2000prh.googlegr oups.com...
hi friends,
I am developing ASP.NET application which allows user to upload the
files upto 10 MB.
But if the user selects the file to upload more than 10 MB the
application crashes with error.
I have tried the follwoing to prevent the crash.

if (System.IO.Path.GetFileName(Request.Path).ToLower( ) ==
"default.aspx")
{
System.Exception appException = Server.GetLastError();
HttpException chkException = (HttpException) appException;
if ((chkException.GetHttpCode() == 500 ||
chkException.GetHttpCode() == 400) && chkException.ErrorCode ==
-2147467259)
{
Session.Add("ImageTooLarge",true);
Server.ClearError();
Response.Redirect("Default.aspx");
}

}

But it didnt help me.
Also I have used Custom errors

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="400" redirect="UploadError.htm" />
<error statusCode="500" redirect="UploadError.htm" />
</customErrors>

This also not helped me from that error.

Friends please help me what to do..
Thanks and regards,
Muthu Kumaran.D

Apr 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ok | last post by:
Hello, Q: How do I get image width and height before uploading an image? This because, I want to restrict people uploading huge files. Thanks in advance
4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
9
by: R. Rajesh Jeba Anbiah | last post by:
Q: How should I handle file upload? A: File uploading requires HTML form of content type "multipart/form-data". The file content has to be POSTed/submitted via the form and once the file is...
10
by: Mario Rodriguez | last post by:
HI people, there is an alternative way to upload files than the ASP.NET native way? Is OK for small files but It doesn't seems to be convenient for an application where there is a lot of paralell...
5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
3
by: detrox | last post by:
Hi, all I have two questions about uploading files using php & html: 1. How can i add a `file type' in the pop window when i click `browse' button of the `<input type=file>'. 2. How can i get...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
2
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
jodleren escribió: I haven't found the PHP manual page where such feature is documented but a few tests have shown that this behaviour changes depending on the charset parameter of the...
3
by: muziburrehaman | last post by:
i am looking for code in php to upload the 1 gb files. any one can please help me by sending the code....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.