Skip to main content
Kofax

How to create a robot that will upload a file to a non-anonymous FTP directory or to an SFTP

Article # 3036531 - Page views: 150

Issue

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.

 

Solution

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)
user
<YourUserNameHere>
<YourPasswordHere>
put <TheFileYouWantToUploadHere> 
quit
  • in the robot, add an Execute Command Line step and set it to execute this line:
ftp -n -s:<theFileContainingtheFTPCommands> <YourFTPServerHere>

For Example: 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:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
put <TheFileYouWantToUploadHere>

 

  • In the robot, add an Execute Command Line step and set it to execute this line:
<PathTo>winscp.com /script=<theFileContainingtheFTPCommands>

 

Level of Complexity 

Moderate

 

Applies to  

Product Version Build Environment Hardware
Kofax RPA all      

References

Add any references to other internal or external articles

 

  • Was this article helpful?