Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: CGI valid header error

by GrandFather (Saint)
on Feb 15, 2007 at 03:01 UTC ( [id://600121]=note: print w/replies, xml ) Need Help??


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

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

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

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-03-28 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found