2012-05-07 9 views
4

Lighttpdの使用を開始しましたが、これは応答ヘッダーを変更する.htaccessファイルです。Apache.htaccessをLighttpdとmod_headersに翻訳してください

<IfModule mod_headers.c> 
    Header unset Content-Type 
    Header unset Content-Disposition 
    Header set Content-Disposition attachment 
    Header set Content-Type application/octet-stream 
    Header add Content-Type application/force-download 
    Header add Content-Type application/download 
    Header unset Content-Transfer-Encoding 
    Header set Content-Transfer-Encoding binary 
</IfModule> 

これをLighttpdでどのように動作させるにはどうすればよいですか?

答えて

3

次を使用する必要があります:

setenv.add-response-header = ("Content-Disposition" => "attachment") 
setenv.add-response-header = ("Content-Type" => "application/octet-stream") 
setenv.add-response-header = ("Content-Transfer-Encoding" => "binary") 

私はあなたがブラウザでファイルを表示するとは対照的に、ファイルのダウンロードを強制しようとしている想像してみ?この場合、RFC 2046(http://tools.ietf.org/html/rfc2046)のようにapplication/octet-stream MIME-Typeが必要です。

'「アプリケーション/オクテットストリーム」エンティティを受け取る実装に推奨されるアクションは、単に提供することです。 Content-Transfer-Encodingを元に戻してファイルにデータを格納したり、ユーザー指定のプロセスへの入力として使用することができます。

関連する問題