All,

I am trying to a call a fly program which generates dynamic images on a webpage and I'm geting this error -> malformed header from script. Bad header=/usr/home/gump/bin/fly:

The main code is as such and I've tried various varaitions of the Content-Type headers to no avail - the simple-lib.pl code which is referred to - I've included as well for reference:

#!/usr/bin/perl5

require 'simple-lib.pl';
&flyprog;

$output = `$flyprog -i $flytemp`;
print "\n\n";
print "Content-Type: text/html\n\n";
print "Content-Type: image/gif\n\n";

print "$output";

#!/usr/bin/perl5

sub flyprog {
  $flyprog = "/usr/home/gump/bin/fly";

}
1;

Hello Koneill

I think that you can only have one content type - presumably you want image/gif

Regards

Geoff

Yes thanks - I tried it with just the one content type -> print "Content-Type: image/gif\n\n"; but still get the malformed header from script error.

Try taking out line 7: print "\n\n";
HTTP expects the header to be terminated by a blank line, and you have given it one here. So it sees an empty header (and presumably ignores the content type on the following line).

Geoff

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.