in reply to Re: Re: Re: Re: Yet another CGI Upload problem - not like the others!
in thread Yet another CGI Upload problem - not like the others!

The limit is not working because (just like with CGI.pm) you have to set the upload size and disable upload stuff before you get to the use. This is becasue when you call use these modules do the actual parsing of the data stream. The correct order (CGI.pm or CGI::Simple.pm) is:

#!/usr/bin/perl use warnings; use strict; # set the stuff $CGI::Simple::POST_MAX = 1024; # max upload via post default 100 +kB $CGI::Simple::DISABLE_UPLOADS = 0; # now when we can load the module and parse the data # it will notice the stuff we set above use CGI::Simple; # if we set POST_MAX or DISABLE_UPLOADS here it is too late....

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

  • Comment on Re: Re: Re: Re: Re: Yet another CGI Upload problem - not like the others!
  • Download Code

Replies are listed 'Best First'.
Re^6: Yet another CGI Upload problem - not like the others!
by fireartist (Chaplain) on Sep 24, 2004 at 23:17 UTC
    Tachyon I notice that the CGI:Simple docs contradict this (very old) node, which is currently correct?

    (From POD)
    use CGI::Simple; $CGI::Simple::DISABLE_UPLOADS = 0; # enable uploads $CGI::Simple::POST_MAX = 1_048_576; # allow 1MB uploads $q = new CGI::Simple;

      Both! With OO usage the data stream parse occurs when you create an object. So you have anytime up until then to set your config params. But with NON-OO use the data stream parse occurs at the time of the use (when you specify you are not going OO). CGI::Simple is primarily an OO module with the method interface added for CGI.pm compatibility.

      cheers

      tachyon