To upload a file to FTP / SFTP through a robot you have to use an Execute Command line step (and use and ftp /winscp command). The same logic in the steps below can be used to run other ftp /winscp commands.
Uploading to FTP
If the FTP directory requires a login, you need to use the -s option of the ftp command (to specify the text file containing the ftp commands).
Follow the steps below to create the robot:
- create a text file with the following content (e.g. C:\Temp\FTPCommands.txt)
- in the robot, add an Execute Command Line step and set it to execute this line:
ftp -n -s:<theFileContainingtheFTPCommands> <YourFTPServerHere>
e.g. ftp -n -s:C:\Temp\FTPCommands.txt ftp.MyMachine.com
Uploading to SFTP
This example uses the winSCP command; more information: http://winscp.net/eng/docs/guide_automation
- create a text file with the following content (e.g. C:\Temp\SFTPCommands.txt)
open sftp://user:firstname.lastname@example.org/ -hostkey="ssh-rsa 2048
- In the robot, add an Execute Command Line step and set it to execute this line:
Note: This command can be saved to a script file and the robot could call this one specifically from the Execute Command Line step
Keywords: Kapow, Robotic Process Automation, FTP, SFTP