I take it you are talking about scripts that use CGI.pm, i.e. contain the line
use CGI
in some form (if you are using something older, such as cgi-lib, I recommend you switch to CGI.pm).
You want to set $CGI::POST_MAX to a sensible number of bytes, which will act as a limit on the size of uploads.
By the way, it's Perl or perl, not PERL.
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ? (Missquoting Janis Joplin)
| [reply] [d/l] |
if someone is uploading a file via a form you can check:
$ENV{CONTENT_LENGTH}
I think there is also the -s test operator if you are checking the file size of a file on the file system.
Update:
As rinceWind said you can limit upload size such as:
$CGI::POST_MAX = 1_048_576; # 1 MB
Hope that helps | [reply] [d/l] [select] |
Hey Guys, Thanx a ton..
I think I have found a nice place for my baby Perl : )
thanks ercparker, rinceWind and dmitri for your time.
Will go back n try this. Hope this should solve the problem.
chou,
| [reply] |
If you use mod_perl and want to have different limits for different CGIs, use local:
local $CGI::POST_MAX = $limit;
| [reply] [d/l] |