in reply to Re: IE trouble
in thread IE trouble
my $size = -s "$path/$file"; ... print `cat $path/file`;instead of appending $file to $path.
Next, a robustness issue: Are you really, really sure that "$path/$file" exists? Better to test first and issue an appropriate error message, rather than hiding an error message from cat in the purported pfd stream.
Lastly, a very minor performance issue: why use cat when you can do the same in process with a few extra lines of Perl?
if ( open(PDF, "<$file/$path" ) {
print "Content-type: application/pdf\n";
print "Content-length: ", -s "$file/$path", "\n";
print "\n";
print <PDF>;
close(PDF);
}
else {
print "Content-type: text/plain\n\n";
print "$file/$path: $!\n";
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: IE trouble
by a (Friar) on Dec 20, 2000 at 09:44 UTC | |
by a (Friar) on Dec 29, 2000 at 04:30 UTC |