次のコードを使用してダウンロードを開始していますが、ダウンロード用のポップアップが開きません。代わりに、その pdf ファイルのバイナリ形式が表示されます。ローカルサーバーでは完全に機能していますが、ホストされたサーバーでは機能していません。
     $file = '../Notes/chapter01.pdf';
if (file_exists($file)) {
    header('Content-Description: File Transfer');
   // header('Content-Type: application/octet-stream');
    header('Cache-Control: public'); // needed for i.e.
    header('Content-Type: application/pdf');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    //header('Cache-Control: must-revalidate');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
                        ob_end_clean();
    flush();
    readfile($file);
    exit;
}
else {
            die('Error: File not found.');
        }