我有这样的代码PHP下载文件头回声
[... page content]
header("Content-type: application/x-download");
header("Content-Length: ".$filesize);
header("Content-Disposition: attachment; filename=".urlLastSeg($buttons['Torrent file(Torcache)']));
header("Content-Transfer-Encoding: binary");
echo $filecontent ;
然后浏览器提示保存文件,但该文件包含一个连接在年底,而不是单独的二进制数据的二进制数据的页面的HTML。
好吧,我想显示一些页面,然后将文件推送给用户。如果标题处于开头,用户在点击下载链接后会看到空白的白色屏幕? – kurdt
点击下载链接后,您需要了解[http](http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) – hek2mgl
,它会加载包含信息的新页面'下载将立即开始',然后会出现浏览器'下载提示'给用户。 – kurdt