hi,
i have used the oreilly package for file uploading. over there the check is
made for the file size. the max. limit is 1mb which is checked like

// Check the content length to prevent denial of service attacks
    int length = req.getContentLength();
    if (length > maxSize) //maxSize is 1MB
    {
      throw new IOException("Posted content length of "+length+ " exceeds
limit of " + maxSize);
    }

Regards,
Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-3140


-----Original Message-----
From: Gerald Reed [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 1:13 PM
To: [EMAIL PROTECTED]
Subject: check file size before upload a file ?


Hi JSP developers,

Is there an easy way to check the file size (and then
stop the process if the file is larger than a
predefined size) before upload a file? I briefly
checked the discussion thread on file upload in this
list. I did not see a direct answer. But, I am sure
someone has worked out a solution.

Thanks in advance!

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to