in reply to File upload is refusing to work

http://search.cpan.org/dist/CGI.pm/lib/CGI.pm#Avoiding_Denial_of_Service_Attacks
$CGI::DISABLE_UPLOADS $CGI::POST_MAX use Data::Dumper; print CGI->escapeHTML(Dumper(CGI->new));
Some even edit CGI.pm to disable uploads

Replies are listed 'Best First'.
Re^2: File upload is refusing to work
by ultranerds (Hermit) on Nov 16, 2010 at 12:57 UTC
    Hi,

    Thanks for the reply. However, I'm not trying to "disable" the uploads - in fact, I WANT to upload files =)

    I did find this in your post interesting though:

    print STDERR " CGI dump: " . Dumper(CGI->new);

    ..which prints out:

    CGI dump: $VAR1 = bless( { '.parameters' => [], 'use_tempfile' => 1, '.charset' => 'ISO-8859-1', '.fieldnames' => {}, 'param' => {}, '.cgi_error' => '400 Bad request (malformed multipart + POST)', 'escape' => 1 }, 'CGI' );


    I've never seen that error before - any ideas what i means?

    TIA

    Andy
      Ok weird... it works now.

      However, $IN is actually a variable from GT::CGI (not CGI.pm):

      my $fh = $IN->param('client_local_offer_image_url'); while (<$fh>) { print STDERR $_; }


      Not sure why CGI.pm wasn't working though - as I've used almost idential code in other projects!

      Thanks for the reply anyway

      Cheers

      Andy
        Point your form to this program and learn how CGI operates (quicker than reading the long documentation)
        #!/usr/bin/perl -- use CGI; use Data::Dumper; my @q = CGI->new("a=b"); push @q, CGI->new({}); push @q, CGI->new(); push @q, CGI->new(); print CGI->header,'<pre>', Dumper(\@q);
        Notice how only $q2 contains POSTed data
      Thanks for the reply. However, I'm not trying to "disable" the uploads - in fact, I WANT to upload files =)

      you were supposed to check those settings to make sure file uploads weren't disabled