Hello,

 My goal is following : after user accesses http://host/script.pl ( either
 by direct link or by submitting the filled form ) I'd like to open a
 "Save as" dialog - to let him download a binary ( compressed ) file.

 1) print header( "application/x-gzip" );
    open ( FIN, "TXTs.tar.gz" );
    binmode FIN;
    print <FIN>;
 
    works, but the file is going to be saved under "script.gz" name instead of
    original "TXTs.tar.gz" - how can I specify the original name ?

 2) Something much simpler :
    print "Location: TXTs.tar.gz\n\n";

    It works as expected and, actually, does what I need, but since I'm
    a new in CGI I'm not sure this is the correct way.

 So, what is the correct way for letting the user to download the binary
 file as script's response ?

 I'll be grateful for any help, thank you !

Reply via email to