<a href>
ビデオ ファイル (mp4) を指すページにリンクがあります。訪問者がリンクをクリックすると、ビデオ ファイルがブラウザ ウィンドウで開きます。
ファイルをダウンロードする場合は、「右クリック」してから「名前を付けてリンクを保存...」する必要があります。
ワンクリックでファイルがダウンロードされるように(右クリックする必要がないように)したいのです。
編集:ここで何が問題なのですか?
<?php
header('Content-Description: File Transfer');
header('Content-Type: video/mp4');
header('Content-Disposition: attachment; filename=file');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
?>