print "Content-disposition: inline; filename=$filename\n";In my experience, if you use "inline", the browser will try to show it itself, but if you use "attachment" instead, it'll download it to disk.
Also, I think it's (probably) safer to quote the filename.
That's from memory, I haven't rechecked it in practice.print "Content-disposition: attachment; filename=\"$filename\"\n";
A few online references:
In reply to Re^2: Downloading a file
by bart
in thread Downloading a file
by JimJx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |