[請益] 壓縮檔
請問一下
我要把檔案打包變成壓縮檔下載
$file = "D:\\www\\"; //檔案路徑
system("tar -zpcf hw1.tgz view_car.c view.c",$output);
//把view_car.c view.c變成壓縮檔
if(!$output=false){
header('Content-Description: File Transfer');
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=hw1.tgz");
readfile($file);
}
是可以下載但是壓縮檔裡是空的,沒有檔案。
請問有人知道為什麼會這樣嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.160.61.127
推
01/27 16:56, , 1F
01/27 16:56, 1F
→
01/27 17:08, , 2F
01/27 17:08, 2F
→
01/27 17:12, , 3F
01/27 17:12, 3F
→
01/27 17:13, , 4F
01/27 17:13, 4F
推
01/27 23:44, , 5F
01/27 23:44, 5F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章