我写了以下内容来下载.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/');