Search code examples
phpftpzipphp-ziparchive

Archive files in ZIP on FTP server before ftp_get() the ZIP file using PHP


I would like to know if there is a way, using PHP, to archive some files in a ZIP on the FTP server (not the PHP server) then proceed with the ftp_get().

So far I can:

  • ftp_get a single file
  • Archive on the PHP server the FTP files, then download it on client. This method is not good cause it makes every single files travel from FTP server to PHP server, then archive on the go and finaly sent to the client (browser).

What I need is really to archive on FTP server then proceed with the ftp_get.

Any idea ? thanks


Solution

  • There's no API in the FTP protocol to ZIP files on a server.


    So unless you have another access interface (like an SSH shell access), you cannot do this.