in reply to Re: Ctrl S function in PERL
in thread Ctrl S function in PERL

A few other notes on this:

Make sure you also print your content-type header. It should probably go before the content-disposition. If it does, then remember you only want one \n at the end:

print "Content-type: text/html\n";

For anyone else that might be doing this with files like PDFs, imgs, etc. here are a couple of other tips:

If you have the file already on the disk, you should also print a Content-length header with the length of the file:

print "Content-length: ", -s $file), "\n";

And for binary files, you should probably call:

binmode STDOUT;

Just in case you script gets run on Windows or the like.

Ted Young

($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)