Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーがphpスクリプトを使用してhtmlファイルをダウンロードできるようにしたい。
これは画像ファイルで可能ですが、html / cssファイルで可能ですか?そうでない場合は、ファイルなどを圧縮して、ユーザーがzipをダウンロードできるようにするにはどうすればよいですか?
phpスクリプトを介してのみ.htmlファイルにアクセスできます。ファイルはパスワードで保護されます。
可能ですが、PHPヘッダーをいじるだけです。
header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"filenamehere.html\");
ファイルを取得して、PHPスクリプトに渡す必要があります。