Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hey,

Is there anything wrong with doing multiple uploads with Perl? Extra security risks? CGI Timeout ? How can I tell whats the max POST size allowed by a CGI script? I'm on Windows and remember hearing that there is a setting on IIS that determines the max post size for a script? I tried looking for this again, but can not. Was wondering if anyone here can offer there help or advice. Thanks a lot.

Replies are listed 'Best First'.
Re: Multiple Uploads
by Cody Pendant (Prior) on Feb 07, 2006 at 08:51 UTC
    You should use CGI.pm, and that has a MAX_UPLOAD setting you can use. That would be the maximum for each upload, not a calculated total.

    I don't think you're going to get timeouts with files of the size you mentioned. The security risk is if some bad person uploads a 10GB file, over and over again until your HD is so full that nothing can run. So a maximum of some kind is probably a good idea.



    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
Re: Multiple Uploads
by zentara (Cardinal) on Feb 07, 2006 at 13:12 UTC
    I'm not sure how it works on IIs, but on linux-apache you can test for the total cumulative size by examing the content_length. I prefer to use this method, because it can stop the upload immediately. But I'm only an amateur at CGI.
    if($ENV{CONTENT_LENGTH} > $maxsize){ print "total files too large - must be less than $maxsize bytes"; exit; }

    I'm not really a human, but I play one on earth. flash japh
Re: Multiple Uploads
by Anonymous Monk on Feb 06, 2006 at 19:35 UTC
    Oh Btw, the files that will be uploaded by this script are .html files that are around the size of 55-90 kb each. So 270kb at most will be uploaded.