Configuring BlueZone

Chapter 5

BlueZone Secure FTP Command Line Switch Support

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 and Batch Files

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""


Common Supported FTP Command via the Command Line

Format: STOR str1

Format: STOR "str1" str2

Format: STOU str1

Format: STOU "str1" str2

Format: APPE str1

Format: APPE "str1" str2

Format: PUT str1

Format: PUT "str1" str2

Format: RETR str1

Format: RETR "str1" str2

Format: GET str1

Format: GET "str1" str2

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).

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).

Format: LIST

Format: LS

Format: DIR

Format: EXIT

Format: QUIT

Format: CWD str1

Format: CD str1

Format: CDUP

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)

Format: REIN

Format: SITE

Format: DELE str1

Format: MKD str1

Format: RMD str1

Format: AUTH

Format: AUTH SSL

Format: AUTH TLS

Format: AUTH TLS-C

Format: AUTH TLS-P

Format: SMNT str1

Format: SMNT str1 str2

Format: SMNT str1 str2 str3

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.

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.


Controlling SSL/TLS and SSH using the /~ Command Line Switch

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:

 

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