【发布时间】:2011-02-16 18:45:41
【问题描述】:
我试图解决我的问题几个小时并搜索了谷歌和几个板,但我没有找到解决方案。
我的问题:我构建了一个 PHP 脚本来生成下载。 代码如下:
$file = "file.pdf";
$download_folder = "../contents/"; //RELATIV
$type= mime_content_type($download_folder.$file);
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"$file\"");
readfile($download_folder.$file);
如果我在我的本地主机服务器 (xampp) 上尝试它,它会工作并且开始下载文件。如果我将脚本上传到我的托管服务器(不是自己的,它已经消失了),我只会得到一个空白页。
有什么想法吗?谢谢!
【问题讨论】: