檔案下載程式碼如下:
$filepath = "/home/file.rar";
$filename = "file.rar";
download($filepath,$filename);
function download($filepath,$filename)
{
$fp = fopen($filepath,"rb");
header('Content-Type: application/octet-stream');
header('Accept-Range:bytes');
header('Content-Disposition: attachment; filename='.$filename);
echo fread($fp, filesize($filepath));
fclose($fp);
}
問一個很蠢的問題,已經找了兩天還是想不到解決辦法><
請問有沒有辦法在檔案下載完畢後跳出一個視窗跟user說檔案已經下載完成了??
或者是有什麼即時性的辦法可以讓user能在檔案一下載完成就知道了??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.125.239.51
→
11/15 16:07, , 1F
11/15 16:07, 1F
→
11/15 16:46, , 2F
11/15 16:46, 2F
→
11/15 18:06, , 3F
11/15 18:06, 3F
→
11/15 19:01, , 4F
11/15 19:01, 4F
→
11/15 23:22, , 5F
11/15 23:22, 5F
推
11/17 00:34, , 6F
11/17 00:34, 6F
討論串 (同標題文章)