Forcing a Download

Randal L. Schwartz merlyn at
Mon Aug 7 16:52:13 CDT 2000

>>>>> "Aaron" == Aaron Kilbey <kilbey at> writes:

Aaron> As i'm sure you all are aware, browsers are so smart that when
Aaron> an href links to a text file it displays it on the screen
Aaron> rather than giving the popup window you would see had the
Aaron> filename extension been unknown or .zip, etc..  Is there a way
Aaron> to force the browser to download a .txt file with PERL.  i can
Aaron> use "Content-type: application/octet-stream\n\n" but the name
Aaron> in the popup window is the same as the cgi, i don't know how to
Aaron> link a file on the server, and i don't know how to make the
Aaron> .txt filename show up. - Aaron


Aaron> -- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at> <URL:>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See for onsite and open-enrollment Perl training!

More information about the Pdx-pm-list mailing list