This is an old revision of the document!
By design, Bizweaver does not include its own FTP functionality. Instead it uses the Execute tool to call any FTP application that supports a command-line interface. The most common application used by Third Wave is winSCP (https://winSCP.net). We have found that winSCP offers all the functionality that is typically required. This page describes how to use winSCP with Bizweaver.
winSCP is initiated from Bizweaver using the Execute tool. This tool calls a Windows batch (.bat) file. The batch file then calls a text file (.txt) that contains the information needed to execute winSCP. Sample scripts are provided below. The scripts can be downloaded or copied and pasted into a local file.
The batch file serves two purposes. First, it initiates the winSCP application and indicates which command file is to be used. This is the second line in the sample that follows. Second, it writes information to a log file. The log file captures the start and end times of each run, as well as the details returned from winSCP about the FTP process. This information can be very helpful when troubleshooting transfer issues.
Note that the various files are placed in a folder named “FTPControls” in the main Bizweaver folder “C:\ProgramData\Bizweaver”. Any folders accessible by Bizweaver can be used for this purpose. Just update the path names in the script. Keep in mind that if you use the path noted in the sample you will need to create the “FTPControls” folder.
echo Starting FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTP Controls\FTPLog.txt" "C:\Program Files (x86)\WinSCP\winscp.com" /script="C:\ProgramData\Bizweaver\FTPControls\WinSCP_Command.txt" /log="C:\ProgramData\Bizweaver\FTPControls\winscp.log" /loglevel=0 /logsize=5*5M" echo Ending FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTPControls\FTPLog.txt"
The “command” file is simply a text file with information used by winSCP during execution. A sample file is provided below to show how the main options are defined.
You can use the winSCP application to generate the command file for you. Information on the this process is found here https://winscp.net/eng/docs/ui_generateurl. Copy the script that is created using this process and save it as your “command” file. Be sure to save the file with the name defined in the batch file.
The sample file provided below a command file. Lines that begin with # are comments. Lines with ## are the actual command. If you chose to use this file as a starting point, remove the ## to include the command.
# Automatically abort script on errors ## option batch abort # Disable overwrite confirmations that conflict with the previous ## option confirm off # Connect # ssh-rsa 2048 6e:2d:96:c3:df:0a:ed:4a:7e:bd:b3:82:e9:4e:9d:22 # The following establishes a connection using an ssh-rsa key # "hostname" is specific to the FTP server where the connection is being made. ## open username:password@hostname.com -hostkey="ssh-rsa 2048 6e:2d:96:c3:df:0a:ed:4a:7e:bd:b3:82:e9:4e:9d:22" # # The following establishes a basic SFTP connection ## open sftp://username:password@hostname.com/ # # List remote folder ## ls # # Change the current working remote folder ## cd /home/user # # Force binary mode transfer ## option transfer binary # # Download file to a local folder # This example also uses the "-delete" option to delete the file on the remote server once is has been downloaded. # The option does not necessarily need to be used. # The target folder may need to be changed ## get -delete *.csv C:\ProgramData\Bizweaver\FTP_In\ # # Upload the file to current working remote folder ## put examplefile.txt # # Disconnect from the remote server ## close # Exit WinSCP ## exit
Complete information about command-line options can be found here https://winscp.net/eng/docs/commandline.