Problem with CGI.pm POST_MAX

From: Bryan (bryan_at_akanta.com)
Date: 03/31/04

  • Next message: Tad McClellan: "Re: Syntax error"
    Date: Wed, 31 Mar 2004 00:56:33 GMT
    
    

    I have a script that uses the following code:
    $CGI::POST_MAX = 1024 * 100; # Set 100K limit on uploads

    my $file = param("upload");
     

    ## Trap exceeded file size error from CGI::POST_MAX
    if (!$file && cgi_error()) {
       print header();
       print "<script language=JavaScript type=text/javascript>\n";
       print "history.back(1);";
       print "alert(\'File size exceeded- There is currently a 100kb max per
    upload file\');";
       print "</script>";
    }

    I have used this before and it worked fine. Now, with a newer version
    of CGI.pm (> 3.0) this functionality no longer works at all. When
    trying to upload a too-large file, the server (apache) just hangs until
    it times out. It never seems to either catch the cgi_error(), or
    perhaps the error is no longer thrown.

    Anyone have any ideas what to do?

    Thanks,
    Bryan


  • Next message: Tad McClellan: "Re: Syntax error"

    Relevant Pages

    • Problem with CGI.pm POST_MAX
      ... ## Trap exceeded file size error from CGI::POST_MAX ... print header(); ... trying to upload a too-large file, the server just hangs until ... perhaps the error is no longer thrown. ...
      (comp.lang.perl.modules)
    • Re: How to put favicon at the HEADER of the HTML
      ... other words the same place as you upload your index.htm file and you ... There are various on-line favicon generators but you can also build them ... I need to put this line at the header of the HTML: ...
      (microsoft.public.publisher.webdesign)
    • Add data at top of text file
      ... I have a text file (CSV) formatted for upload using an FTP tool; ... to add a certain header to the top of the text file, ...
      (microsoft.public.excel.programming)
    • post image to webhoster - upload file with http
      ... I want to upload an image to imageshack in C++. ... where I can specify a url, post data and header. ... Do I need to include the image data in the ...
      (alt.php)