Re: [請益] 壓縮檔

看板PHP作者 (知足常樂)時間18年前 (2008/01/28 15:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《ntouckcm (知足常樂)》之銘言: : 請問一下 : 我要把檔案打包變成壓縮檔下載 : $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); : } : 是可以下載但是壓縮檔裡是空的,沒有檔案。 : 請問有人知道為什麼會這樣嗎? tar指令是不是Linux系統下才能執行的指令呢? window xp系統下 此指令可以work嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.160.70.161
文章代碼(AID): #17dODBei (PHP)
討論串 (同標題文章)
文章代碼(AID): #17dODBei (PHP)