Transferring Files (FTP)

In ApplinX Framework, it is possible to transfer files from the client to the host or from the host to the client, using the FTP dialog screens. The HTML emulation contains a link in the footer that opens an FTP Web dialog box.


FTP Configuration

To upload/download files using the FTP option, you need to configure a number of parameters in the Framework Configuration Editor.

Start of instruction setFTP Configuration:

  1. Open a new browser and run your Web application.

  2. Click on the Framework Configuration link. The Configuration Editor will be displayed.

  3. Expand the FTP node.

  4. Select the Host type.

  5. Enter the Host address.

  6. Click Save to save your changes.

  7. Click Close to return to the Web application.

  8. When working with an application which is not an HTML emulation, add an element such as a link or a button which when clicked will call the gx_openFtpDialog() JavaScript function (in an HTML emulation this is built-in).

Refer to Using FTP to Upload Files and Using FTP to Download Files.

Opening the File Transfer Dialog Box

To work with an application which is not an HTML emulation, add an element, such as a link or a button, to your master page (template.jsp/template.master.cs) or to any generated page. Place it in a suitable location. Set the link to call gx_openFtpDialog();.

Example:

<input type="button" id="FTPtButton" value="FTP" onClick="gx_openFtpDialog();" />

Refer to the API:

Using FTP to Upload Files

Start of instruction setTo upload files:

  1. Configure the FTP parameters as detailed in FTP Configuration.

  2. Open the ApplinX HTML Emulation and run your Web application.

  3. Click on the upload image to display the Upload dialog box.

  4. Click on the Upload button. The File Upload screen will be displayed.

  5. Enter the User name and Password (mandatory).

  6. Enter the name of the file you would like to upload (Remote file). (Mandatory).

  7. Click Browse... to enter the location and file name of the uploaded file.

  8. Fill in the host property fields (these fields are optional and differ according to the configured host):

    AS/400 Hosts:

    1. Select the data representation type: ASCII, EBCDIC, IMAGE, DBCS_EBCDIC, EBCS_EBCDIC or CCSID.

    2. Select the structure of the data that is to be transferred: File or Record.

    3. Select the mode Stream or Block to determine whether records are transmitted record-by-record or as a continuous stream of bytes.

    Mainframe Hosts:

    1. Select the data representation type: ASCII, EBCDIC, IMAGE, UNICODE 2 B or UNICODE 2 L.

    2. In the Record format field, specify the type of records in the data set: Fixed, Variable or Undefined.

    3. In the LRECL field, specify the logical record length (in bytes).

    4. In the Block size field specify the physical length of the data (in bytes).

    5. In the Primary field specify the number of tracks or blocks initially allocated to the data set.

    6. In the Secondary field specify the number of tracks or blocks if the primary allocation is exceeded.

  9. It is possible to enter a user defined command in the Command field.

  10. Click Upload. The upload process may take some time and is dependant on the size of the file and the connection.

  11. A message will be displayed indicating that the upload was successfully completed. If there is a failure when uploading the file, an error message will appear.

Using FTP to Download Files

Start of instruction setTo download:

  1. Configure the FTP parameters as detailed in FTP Configuration.

  2. Open the ApplinX HTML Emulation and run your Web application.

  3. Click on the download image to display the Download dialog box.

  4. Click on the Download button. The File Download screen will be displayed.

  5. Enter the User name and Password (mandatory).

  6. Enter the path and file name of the source file that is to be downloaded (mandatory).

  7. Fill in the host property fields (these fields are optional and differ according to the configured host):

    AS/400 Hosts:

    1. Select the data representation type: ASCII, EBCDIC, IMAGE, DBCS_EBCDIC, EBCS_EBCDIC or CCSID.

    2. Select the structure of the data that is to be transferred: File or Record.

    3. Select the mode Stream or Block to determine whether records are transmitted record-by-record or as a continuous stream of bytes.

    Mainframe Hosts:

    1. Select the data representation type: ASCII, EBCDIC, IMAGE, UNICODE 2 B or UNICODE 2 L.

    2. In the Record format field, specify the type of records in the data set: Fixed, Variable or Undefined.

    3. In the LRECL field, specify the logical record length (in bytes).

    4. In the Block size field specify the physical length of the data (in bytes).

    5. In the Primary field specify the number of tracks or blocks initially allocated to the data set.

    6. In the Secondary field specify the number of tracks or blocks if the primary allocation is exceeded.

  8. It is possible to enter a user defined command in the Command field.

  9. When the file is a text file, it is possible to determine whether you would like to convert the downloaded file to Windows text mode, DOS text mode or UNIX text mode.

  10. Click Download. The Windows File Download window will be displayed enabling you to save or open the file. If there is a failure when downloading the file, an error message will appear.