[PHP-users 33393] Re: symfonyで静的ファイルをダウンロードしたい

kobayashi kobayashi @ dyerit.com
2008年 3月 18日 (火) 08:46:29 JST


石丸さま

小林です。
回答遅くなりまして誠に申し訳ありません。
そしてお返事ありがとうございました。

ご提示いただいたプレーンphpをsymfony仕様に焼き直して処理ができましたので
ご報告いたします。

> header("Cache-Control: public, must-revalidate");
> header("Pragma: hack"); // WTF? oh well, it works...
> header("Content-Type: " . $mm_type);
> header("Content-Length: " .(string)(filesize($myFile)) );
> header('Content-Disposition: attachment; filename="'.$filename.'"');
> header("Content-Transfer-Encoding: binary\n");
↓
symfonyのMVCにViewのレスポンスヘッダ用のファイルview.ymlに記載。

> readfile($myFile);
SymfonyのMVCのViewのデータ部ファイルにあたるxxxxSuccess.phpに記載。

敬具


PHP-users メーリングリストの案内