ファイルをダウンロードさせるときのhttp header とファイル名

Content-Dispositionヘッダでファイル名を指定。

Content-Disposition: attachment; filename="hoge.txt"

perlCGIモジュールなら

$self->header(
  -attachment => 'hoge.txt',
);

とすればContent-Dispositionにhoge.txtを含めてヘッダ出力してくれる。

www.studyinghttp.netにはお世話になりっぱなしだ。