Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET Databases Also see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 15th, 2006, 08:05 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Upload file size limitation in ASP.NET

Hi All,

    I am trying to upload files in my application using ASP.NET.
    I need to restrict the file size to 11 MB. But i am unable to restrict the size. I am trying to get the uploaded files count to check the file size in Application_BeginRequest event of Global.ascx.cs.

   I am not getting the uploaded files count. How to limit the file size in ASP.NET ?

  Can any one help me ? Its very urgent..


Thanks in Advance,
Natraj.

Reply With Quote
  #2 (permalink)  
Old March 15th, 2006, 08:35 AM
Wrox Technical Editor
 
Join Date: Nov 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take a look at the ContentLength property.

Here's a tutorial of interest:
File Upload with ASP.NET: http://www.codeproject.com/aspnet/fileupload.asp

- A.Kahtava
Reply With Quote
  #3 (permalink)  
Old March 15th, 2006, 09:05 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your quick response !

My problem.. If i try to upload more than maximum request length(I setup the max req length as 11264), it is throwing exception as Maximum Request Length has exceeded...

I am unable to catch that exception because the application is throwing at applciation begin request. It is not throwing at code behind of that page.

Now, Are you clear at my problem ?

Thanks Again,
Natraj.

Reply With Quote
  #4 (permalink)  
Old May 7th, 2006, 12:33 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik Send a message via Skype™ to melvik
Default

How do u upload ur files?! if u do it manually & urself, I mean with the code u done, u can get the file size before uploan & restrict big files to be uploaded.

Tell me if u want the code to do it.

Always:),
Hovik Melkomian.
Reply With Quote
  #5 (permalink)  
Old December 28th, 2006, 04:10 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi melvik,
Please provide me the code to check the file size before uploading in ASP.NET. Scripting.FileSystemObject does not work under many other browsers and also sometimes does not work even in IE.
Reply With Quote
  #6 (permalink)  
Old June 26th, 2007, 05:08 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Melvik, could you send me the code please.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ch. 2 what is the file size limit to upload? cluce BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 February 19th, 2008 03:48 PM
Filter File Types in ASP.NET File Upload ramuis78 ASP.NET 2.0 Basics 2 May 31st, 2007 10:50 AM
file upload in ASP.net problem lpastor ADO.NET 1 September 15th, 2004 08:55 AM



All times are GMT -4. The time now is 11:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.