Unpacking a ZIP archive from FTP in PHP

How can I extract a zip archive via ftp? Is that possible?

Answer 1

I would recommend using an online ftp client such as net2ftp.com. Very convenient, because can be accessed from anywhere.
There is a function for downloading a .zip archive, with automatic unpacking to the current directory.

If you want to do this programmatically on your server, then I can recommend the library PclZip.

$archive = new PclZip('.zip');
if ($archive->extract() == 0) die("Error : ".$archive->errorInfo(true));
else echo('Ok!');

Answer 2

This can be done through some ftp client. For example, I use net2ftp, but the simplest and most popular is ftpadmin. You can download it here: http://sourceforge.net/projects/ftpadmin/