次の機能を使用してpdfファイルをダウンロードしています。PCまたはラップトップからダウンロードすると正常に動作しますが、iPadを使用してダウンロードリンクをクリックすると、多くの特別な文字が含まれるページが開き、ファイルをダウンロードできません.
私のダウンロード機能は
public function download() {
$download_path = $_SERVER['DOCUMENT_ROOT'] . "/import";
$filename = $_GET['file'];
$file = str_replace("..", "", $filename);
$file = "$download_path/$file";
if (!file_exists($file))
die("Sorry, the file doesn't seem to exist.");
$type = filetype($file);
header("Content-type: $type");
header("Content-Disposition: attachment;filename=$filename");
header('Pragma: no-cache');
header('Expires: 0');
readfile($file);
}
このエラーについて何か考えはありますか?