用PHP提取.tgz的问题

时间:2013-07-12 11:40:48

标签: php unix exec tar

我写了以下内容来下载.tgz并将其解压缩到指定位置。它正在成功下载但未提取文件。我个人在这里看不到问题:

// Delete old zip
$myFile = "file.seam?fileName=images.tgz";
unlink($myFile);

// Get new zip
$url = "http://shop.x.co.uk/file.seam?fileName=images.tgz";
$fh = fopen(basename($url), "wb");
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_exec($ch);
curl_close($ch);

// Extract 
exec('gtar --keep-newer-files -xzf file.seam?fileName=images.tgz --strip-components=2 -C /home/topgoth/public_html/getimages/images/');

0 个答案:

没有答案