1

Is it possible to compress the all files inside of FTP, and then download it? The file transfer each file is too slow. If it is possible is there a Documentation for this? I have search already in Google but It seems there's no way to do this.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
bpoom za
  • 75
  • 1
  • 7

1 Answers1

0

It is hardly possible.

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


Though, it's not uncommon that one, in addition to an FTP access, have also an SSH access. If that's the case, you can connect with the SSH and execute the zip shell command (or similar) on the server to compress the files.

With WinSCP .NET assembly, you can use Session.ExecuteCommand for that.

If you need, you can then download the archive using the FTP protocol (Though if you have the SSH access, you will also have an SFTP access. Then, use the SFTP instead of the FTP.).


Some (very few) FTP servers offer an API to execute an arbitrary shell (or other) commands using the SITE EXEC command (or similar). But that's really very rare. You can use this API the same way as the SSH above.


The above is based on my answer to a similar question about unzipping:
Can we unzip file in FTP server using C#

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992