Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: CGI valid header error

by csuhockey3 (Curate)
on Feb 15, 2007 at 02:54 UTC ( #600119=note: print w/replies, xml ) Need Help??

in reply to Re: CGI valid header error
in thread CGI valid header error

The header error is out of the error log. The browser just prints the ol' generic Server Error. I'll try dorko's suggestion of moving the print outside the sub.

Replies are listed 'Best First'.
Re^3: CGI valid header error
by GrandFather (Saint) on Feb 15, 2007 at 03:01 UTC

    I'd try commenting out chunks of code until you get the minimum code that generates the error. Very likely the bug will pop out and hit you in the eye in the process. If not, post the reduced code here. Note that you shouldn't need any external files or system calls to reproduce the problem! Show us the exact error line from your log too may help.

    Does the following produce clean results for you?

    #!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); $CGI::POST_MAX = 2097152; ## (2mb upload max) $CGI::DISABLE_UPLOADS = 0; ## allow uploads my $upload_path = "/export/"; #my $filename = $upload_path . param('excel'); sub print_header { my $title = shift; print header, start_html($title); } sub init { my $upload = 0; unless (param('excel')) { print_header ('Excel to XML Converter'); #print_upload_form(); ## make sure there's actually something being uploaded } elsif (!$upload && cgi_error) { print_header ('Excel to XML Converter: Error!'); print h1("No file uploaded!"); ## all is well, show conversion confirmation } else { show_convert(); } } init(); print end_html();

    DWIM is Perl's answer to Gödel
      Hi GF
      The upload part does indeed work, here is the exact error log message from before:

      failure ( 171): for host ***.***.**.*** trying to POST /cgi-bin/upload.cgi, cgi_scan_headers reports: HTTP4044: the CGI program /cgi-bin/upload.cgi did not produce a valid header (program termindated without a vaild CGI header.

        Ok, so start adding bits in until it breaks. Note that you should fudge around actually doing the conversion work until you absolutely have to - just put a dummy table in for example.

        DWIM is Perl's answer to Gödel

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://600119]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2021-01-23 21:43 GMT
Find Nodes?
    Voting Booth?