Configuring BlueZone |
Chapter 5 |
BlueZone Secure FTP also has support for Command Line Switches. They work exactly the same way as with the other BlueZone emulators. Please note that some of the commands are repeated, and they do not necessarily perform the same function.
BlueZone Secure FTP can be launched from a DOS batch file. Because BlueZone Secure FTP has support for Command Line Switches, it is possible to control the launching of BlueZone Secure FTP.
Basic Examples:
If you want to launch BlueZone Secure FTP from a batch file and include a configuration file named "config.zft" to start the BlueZone Secure FTP session, you would use there /F Command Line Switch.
"C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE" /Fconfig.zft
If you want to launch BlueZone Secure FTP from a batch file and set the "Initial PC Directory" to a folder called C:\MyFiles, you would use the /I command line switch.
"C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE" /Ic:\MyFiles
You can also combine Command Line Switches in one statement. For example, here's how it would look if you wanted to combine the two examples above.
"C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE" /Fconfig.zft /Ic:\MyFiles
Other Examples:
Initial Commands (/L command line switch) are used to configure FTP to perform specific FTP commands upon connect. For example, suppose you wish to configure BlueZone Secure FTP to perform an upload of a file named "upload.txt" and then a download of a file named "download.txt" during your batch execution. The command line switch would be:
BZFTP.EXE /L"STOR upload.txt" /L"RETR download.txt" /L"EXIT"
The /L"EXIT" command line switch will close BlueZone Secure FTP once the Initial Commands complete. There are sometimes issues with getting double quotes to appear inside other double quotes through a batch file. In BlueZone Secure FTP, we have implemented two characters to translate into double quote and a blank space. The '&' translates into a double quote (") and the '%' translates into a blank space ( ). The following is an example:
BZFTP.EXE /L"STOR &upload.txt& upload" /L"EXIT"
This would translate the STOR command to "STOR "upload.txt" upload", which would upload the local file "upload.txt" to the host as "upload".
NOTE Some scripting and programming languages support the use of "double double quotes". The following example shows the use of double double quotes when you are calling BlueZone Secure FTP to run from a program or script using the /Z and /L commend line switches.
Run "C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE /Z0 /L""RETR F1201.CSV""
STOR - Uploads a local file to the host. If str2 is in the command then the filename on the host will be set to str2. instead of str1.
Format: STOR str1
Format: STOR "str1" str2
STOU - This command behaves like STOR except that the resultant file is to be created on the host under a name unique to that directory.
Format: STOU str1
Format: STOU "str1" str2
APPE - This command behaves like STOR except that if the resultant file already exists on the host the contents of the local file are appended to the host file.
Format: APPE str1
Format: APPE "str1" str2
PUT - This command behaves like STOR.
Format: PUT str1
Format: PUT "str1" str2
RETR - Downloads str1 from the host and stores it on the local computer. If str2 is in the command then the filename is stored on the local computer as str2.
Format: RETR str1
Format: RETR "str1" str2
GET - This command behaves like RETR.
Format: GET str1
Format: GET "str1" str2
MPUT - Uploads multiple files to the host. Wildcards (*) are supported in this command. Ex. MPUT *.txt will upload all the txt files in the current directory to the host.
Format: MPUT str1
Format: MPUT str1 str2 str3 etc. (long file names containing spaces are not supported in this command, use multiple STOR commands instead).
MGET - Downloads multiple files from the host. Wildcards (*) are supported in this command. Example: MGET *.txt will download are the txt files in the current host directory from the host.
Format: MGET str1
Format: MGET str1 str2 str3 etc. (long file names containing spaces are not supported in this command, use multiple RETR commands instead).
LIST - Performs a listing of the current host directory.
Format: LIST
LS - Performs a listing of the current host directory. Not all hosts support this command.
Format: LS
DIR - Performs a listing of the current host directory. Not all hosts support this command.
Format: DIR
EXIT - Closes the BlueZone FTP program.
Format: EXIT
QUIT - Disconnects the connection to the host.
Format: QUIT
CWD - This command changes the current working directory on the host.
Format: CWD str1
CD - This command behaves like CWD.
Format: CD str1
CDUP - This command changes the current directory to its parent directory.
Format: CDUP
TYPE - This command changes the data type used for file transfer.
Format: TYPE A (Sets Type to ASCII)
Format: TYPE I (Sets Type to Binary)
Format: TYPE E (Sets Type to EBCDIC)
Format: TYPE F (Sets Type to Double-Byte EBCDIC)
Format: TYPE B (Sets Type to Double-Byte ASCII)
REIN - This command terminates a USER, the state is now the same as after a connection is opened. A USER command may be expected to follow.
Format: REIN
SITE - This command is used by the server to provide services specific to the system that may be essential to file transfer. The nature of these services and the specification of their syntax can be stated in a reply to the HELP SITE command.
Format: SITE
DELE - This command causes the file specified in str1 to be deleted on the host.
Format: DELE str1
MKD - This command causes the directory specified in str1 to be created as a directory (if str1 is absolute) or as a subdirectory of the current working directory.
Format: MKD str1
RMD - This command causes the directory specified in str1 to be removed. If the directory is not empty then BlueZone FTP will try to recursively delete the contents in any subfolders.
Format: RMD str1
AUTH - This command causes BlueZone Secure FTP to start a SSL handshake with the host.
Format: AUTH
Format: AUTH SSL
Format: AUTH TLS
Format: AUTH TLS-C
Format: AUTH TLS-P
SMNT - This command allows the user to mount a different file system data structure. Format depends upon the host.
Format: SMNT str1
Format: SMNT str1 str2
Format: SMNT str1 str2 str3
IFTD - This command is unique to BlueZone Secure FTP. An iSeries File Transfer download is started with this command.
Format: IFTD Library iSeries_File FFD Type PC_FileName
Where: Library is the library on the iSeries server.
Where: iSeries_File is the data file to use for the transfer.
Where: FFD is the file field descriptor.
Type: 0 for XLS, 1 for CSV, 2 for Tab-delimited(txt).
Where: PC_FileName is the destination filename for the XLS, CSV, or TXT file.
IFTU - This command is unique to BlueZone Secure FTP. An iSeries File Transfer upload is started with this command.
Format: IFTU Library iSeries_File FFD PC_FileName
Whrer: Library is the library on the iSeries server.
Where: iSeries_File is the data file to use for the transfer.
Where: FFD is the file field descriptor.
Where: PC_FileName is the destination filename for the XLS, CSV, or TXT file.
It is possible to use a Command Line Switch to disable encryption, enable Explicit SSL/TLS, enable Implicit SSL/TLS and enable SSH encryption. This is accomplished by using the /~ command line switches.
BlueZone Secure FTP supports the following encryption command line switches:
/~0 - Disable Encryption
/~1 - Enable Explicit SSL/TLS Encryption
/~2 - Enable Implicit SSL/TLS Encryption
/~3 - Enable SFTP Encryption
For example, if you wanted to start a BlueZone Secure FTP session with Explicit SSL/TLS Encryption enabled, use the /~1 command line switch when starting the session. The /~1 command line switch has the same affect as selecting Explicit FTPS (SSL/TLS) from the Security Options drop down listbox on the Security tab when you are configuring a host connection. Any additional SSL or TLS settings that are required, must be set and saved in the BlueZone Secure FTP configuration first.
The following is an example of starting a BlueZone Secure FTP session with Explicit SSL/TLS encryption enabled.
"C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE" /~1
Conversely, if you wanted to start a BlueZone Secure FTP session with encryption disabled, use the /~0 command line switch to disable SSL/TLS encryption. The /~0 command line switch has the same affect as unchecking the Enable Secure Sockets Layer checkbox on the Security tab.
The following is an example of starting a BlueZone Secure FTP session with encryption disabled.
"C:\Program Files\SEAGULL\BlueZone\BZFTP.EXE" /~0
SEE The BlueZone Secure FTP Command Line Switch Table for a complete listing of Command Line Switches.
Related Topics:
BlueZone Command Line Switch Support