I can not find the answer that I need, so I hope you understand what I need.
I need to open the tar.gz file (from a remote site), read the files, and copy / replace these files on my website. I tried this code (as well as many other codes):
$zipFile= 'http://awebsite.com/file.tar.gz';
$dir = 'myfolder';
$zp = @gzopen($zipFile, "r");
$fp = @fopen($dir, "w");
while(!@gzeof($zp)) {$string = @gzread($zp, 4096); @fwrite($fp, $string, strlen($string));}
@gzclose($zp);
@fclose($fp);
Everyone seems to be coming up with all sorts of mistakes. It seems I can read the zip file, but I don’t actually save the content on my website.
Thanks for any help in advance.
Creton
source
share