3

How is it possible to Zip, Download and Delete (ZDD) a file in WinSCP?

For example, your local dir is Desktop and your remote dir (the one in your server machine) is, say, /var/www/html and you want to zip and download a particular dir or file, and then you want it to be removed the moment the download was finished.


enter image description here


To further explain, in linux I could do, for example:

(
zip -r /var/www/html/dr.zip /var/www/html
scp /var/www/html/dr.zip USER@IP:/location
rm /var/www/html/dr.zip
)

I need similar thing for WinSCP yet I'm aware that the WinSCP download mechanism should be used and that it is different then the Nix scp utility.

My question:

Do you know a way to achieve this with WinSCP?

3

There's no way to ZIP files over any file transfer protocol (SFTP, FTP, SCP or WebDAV). That's why there's no such function in WinSCP, as it cannot be implemented reliably.


Though, if you have a shell access to the server, you can use a shell command to ZIP the files. That's actually, what the Tar/GZip custom command does.

If you want it in one-go (zip-and-download), there's now a WinSCP extension that does exactly this:
Archive remote files to ZIP archive, download it, and optionally extract it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy