Hi,

Each POST request has a header Content-Length*. The value of this tells the
length of the request.
Using this you may be able to achieve the desired functionality.

A pseudo code of the form

int length = request.getContentLength();
if( length > RESTRICTED LENGTH)
{
    // take some action..
}
else
{
...
...

You may also look at Jason Hunters file uploading package available from
www.orielly.com It provides an inbuilt functionality for this in the
MultipartRequest class.

Regds,
Gokul

----- Original Message -----
From: "Mark Koscak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 29, 2000 8:41 AM
Subject: [SERVLET-INTEREST] How do I stop people dumping large files on my
server using POST


> Hello everyone,
>
> I have spent some time on the archives, as yet I have been unable to find
> information on this quesiton.
>
> If I have a servlet that processes form data using POST, do I have to add
> functionality to stop people potentially dumping large files on the form
and
> uploading these to the server?
>
> Do servlets automatically restrict the size of data a user can send or can
> we restrict this manually. If we can restrict upload size how would I go
> about doing this.
>
> Thank-you for your consideration.
>
> Regards
> Mark
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to