in reply to Re: file upload, max_post, and cgi-error
in thread file upload, max_post, and cgi-error

Well, your code (the header/error part of it) ran properly for me. Here is a slightly more explicit version you might try on your own server. I'm running Apache 2.

use warnings; use strict; use CGI qw(:standard); $CGI::POST_MAX = 2_000; # play nice my $uploaded_file = param('upload'); if ( not $uploaded_file and cgi_error() ) { print header(-status=>'200 OK'), # this might help, or not... start_html(-title=>'TOO BIG'), h2("Why are you disrespecting me with that file size?"); } else { print header(), start_html(-title=>'Just right!'), h2("I'm Okay, You're not so bad."); } print start_multipart_form(), filefield(-name=>'upload'), submit('Upload'), end_form(), end_html();

Replies are listed 'Best First'.
Re^3: file upload, max_post, and cgi-error
by nponte (Initiate) on Oct 05, 2004 at 17:11 UTC
    thanks for the script. I ran this on my system and get "Page cannot be Displayed" when I specify a file larger than post_max. Same behavior as my script.