Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: CGI valid header error

by f00li5h (Chaplain)
on Feb 15, 2007 at 02:49 UTC ( [id://600118]=note: print w/replies, xml ) Need Help??


in reply to CGI valid header error

Or perhaps have a look in your webserver's error log...

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Replies are listed 'Best First'.
Re^2: CGI valid header error
by csuhockey3 (Curate) on Feb 15, 2007 at 02:54 UTC
    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.

      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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found