使用header下载文件
想等下载完成后跳转到其他页面怎么做啊down.php
header部分如下
header("Cache-control: private");
header("Content_Type: application/x-doc");
header("Content-Disposition: attachment; filename=".$DB -> RConn["AFileNum"][0].".doc");
readfile($newFile);页面的载入过程如下
main.php页面单击按钮(使用top.location.href=....做的)进入down.php.
我想等待下载完成后跳转回index页面
现在下载完成后留在main.php页面一个空白,刷新后才能到index页面,不知道这期间可以怎么弄
想等下载完成后跳转到其他页面怎么做啊down.php
header部分如下
header("Cache-control: private");
header("Content_Type: application/x-doc");
header("Content-Disposition: attachment; filename=".$DB -> RConn["AFileNum"][0].".doc");
readfile($newFile);页面的载入过程如下
main.php页面单击按钮(使用top.location.href=....做的)进入down.php.
我想等待下载完成后跳转回index页面
现在下载完成后留在main.php页面一个空白,刷新后才能到index页面,不知道这期间可以怎么弄
header(location...不行)
header("Cache-control: private");
header("Content_Type: application/x-doc");
header("Content-Disposition: attachment; filename=".$DB -> RConn["AFileNum"][0].".doc");
$rs=readfile($newFile);
if($rs){
echo '<script>alert("下载完成");window.location=index.php;</script>';
}else{
echo '<script>alert("下载失败");window.location=index.php;</script>';
}