How to unzip an archive file on the SFTP server that has just been uploaded or downloaded?
If you need to extract an archive file on the SFTP server after a successful file transfer, you should use a post-transfer trigger.
A post-transfer trigger is executed after a successful file transfer between the remote server and the local computer and allows you to execute any sequence of shell commands or a shell script. As parameters, you can use built-in FTPGetter variables such as the %remote_file% variable, which represents the full path of the transferred file on the SFTP server, date-related variables, and others.
Important note! To execute shell commands on the SFTP server, your account must have shell access rights. It is very easy to check whether you have these rights — you should be able to execute commands on the SFTP server in the terminal. If your account on the SFTP server does not have such rights, contact the SFTP server administrator to request this permission!
Example #1: Extract the transferred archive file on the SFTP server.
To perform this operation, add the following command to the shell script text field.
unzip %remote_file% -d /path-to-unzip-folder/
How it works. After a successful file transfer, FTPGetter executes the unzip shell command with two parameters. The first parameter is the %remote_file% variable, which contains the full path of the recently transferred file (on the SFTP server). The second parameter is the full path to the folder on the SFTP server where the archive file should be extracted.
Next, we will look at how to copy, move or rename a recently uploaded file.
Need to unzip an archive file on the local computer after transfer?


