我使用以下功能下载pdf文件时,它工作正常,当我从PC或笔记本电脑下载时,但当我点击下载链接使用ipad时,它打开一个页面,有很多特殊的字符和我我无法下载该文件。无法使用ipad下载pdf
我的下载功能是
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);
}
关于此错误的任何想法?
确保字符集匹配 – 2012-04-12 12:30:22
字符集应该是什么?我正在使用utf-8 – 2012-04-12 12:32:11
确保这就是您的iPad所看到的。 – 2012-04-12 12:32:29