Is there a way to limit the size of files transfered to Allegroserve?
I don't want users to jam my server by uploading huge files. It
appears that Allegroserve does not honor MAX_FILE_SIZE. Here's an
example:
My HTML reads:
<form enctype="multipart/form-data" action="upload" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
I have two files which are 29999 and 30001 bytes respectively:
wc -c small.txt big.txt
29999 small.txt
30001 big.txt
60000 total
Both these are accepted by the server, first the 29999 case
WEB> (slot-value *debug-http* 'net.aserve::request-header-content-length)
"30342"
WEB> (subseq (slot-value *debug-http* 'net.aserve::request-body) 0 300)
"-----------------------------1345092078723595011512718496^M
Content-Disposition: form-data; name=\"MAX_FILE_SIZE\"^M
^M
30000^M
-----------------------------1345092078723595011512718496^M
Content-Disposition: form-data; name=\"userfile\"; filename=\"small.txt\"^M
Content-Type: text/plain^M
^M
·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@"
And the 30001 case:
(slot-value *debug-http* 'net.aserve::request-header-content-length)
"30345"
WEB> (subseq (slot-value *debug-http* 'net.aserve::request-body) 0 300)
"-----------------------------68352664017398777681354972185^M
Content-Disposition: form-data; name=\"MAX_FILE_SIZE\"^M
^M
30000^M
-----------------------------68352664017398777681354972185^M
Content-Disposition: form-data; name=\"userfile\"; filename=\"big.txt\"^M
Content-Type: text/plain^M
^M
·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@·@"
WEB>
Any ideas on how to set the file maximum file size limit for uploaded
files? Allegroserve seems to get jammed during upload of large files.
I'm using Portable Allegroserve:
WEB> net.aserve::*aserve-version-string*
"1.2.42"
WEB> (lisp-implementation-type)
"CMU Common Lisp"
WEB> (lisp-implementation-version)
"CVS release-19a 19a-release-20040728 + minimal debian patches"
Thanks
Petter
--
________________________________________________________________________
Petter Gustad 8'h2B | ~8'h2B http://www.gustad.com/petter