Extract ZIP-file to ftp-server
Posted: Thu Jun 14, 2007 5:05 am
For one of our projects, we need to export a folder structure from the ftp-server (linux) to a PC and import folder structures to the ftp-server.
We decided to work with zip(using PclZip --> http://www.phpconcept.net/pclzip/index.php ) to export and import the folders automatically.
We are able to export the zip file and we can put a zip file from a PC to the ftp-server.
The problem is when we import the zip file and extract it on the server, we do not have write permissions on the folders.
We do have write permission on the files in these folders using this code:
This is the only function in the class that can change the permissions but it only affects the files in the folders, not the folders. This way, we cannot
change/delete the content of the files. We contact the creater of this class and he says that the permission-code should also affect the folders, but it doesn't.
We also tried another method using GZip ( http://www.php.net/zlib ). We have thesame problem using this.
Would anyone know if this problem occurs because our ftp-server just can't work with this and if not, is there another way
to put folder structures from a PC to a ftp-server?
We decided to work with zip(using PclZip --> http://www.phpconcept.net/pclzip/index.php ) to export and import the folders automatically.
We are able to export the zip file and we can put a zip file from a PC to the ftp-server.
The problem is when we import the zip file and extract it on the server, we do not have write permissions on the folders.
We do have write permission on the files in these folders using this code:
Code: Select all
require_once("pclzip.lib.php"); // Read the class
$zip = new PclZip("$web_location"); //select the zip that we imported to the server
if($zip->extract(PCLZIP_OPT_SET_CHMOD, 0777) == 0) //extract the zip with permission 0777 (all users can read, write and execute the files)
die("Error : " . $zip->errorInfo(true));change/delete the content of the files. We contact the creater of this class and he says that the permission-code should also affect the folders, but it doesn't.
We also tried another method using GZip ( http://www.php.net/zlib ). We have thesame problem using this.
Would anyone know if this problem occurs because our ftp-server just can't work with this and if not, is there another way
to put folder structures from a PC to a ftp-server?