Share this page

# ftp_get

FTP Functions (ftp)

Gets a file from an FTP server.

    int ftp_get( char *transaction, <item list>, LAST );

Function objFTP.get( transaction as String, item_list as String, LAST) as Integer ' for VB Script

transaction | A transaction name for this step. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
item_list | A list of all the items for this function. Enclose all entries with quotes. Specify either SOURCE_PATH or MSOURCE_PATH. SOURCE_PATH - The full FTP server path of the file to retrieve. MSOURCE_PATH - The full FTP server path of the files to retrieve, using wildcards to specify multiple files. If no wildcards are used, all files in the MSOURCE_PATH are fetched. Wildcard behavior is determined by the FTP server software. If the argument contains wildcards, make sure you test your script on each FTP version you are going to run tests on. TARGET_PATH - (optional) - the path and filename in which to store the retrieved file. If you omit this item, the file will not be stored. PASSIVE - (optional) - Sets the communication protocol to Passive Mode FTP. To enable, pass "PASSIVE=TRUE". MODE - (optional) - Retrieval mode ASCII or BINARY (default). ENDITEM - Marks the end of the item list. (no quotes)
LAST | A marker indicating the end of the argument list.

The ftp_get function gets the working directory on the FTP server.

This function is for use with global sessions. For multiple sessions, use the ftp_get_ex function, which allows you to specify a session identifier.

## Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.

## Parameterization

The following argument(s) can be parameterized with standard parameterization: List of Attributes

## Example

In the following example, the ftp_get function gets the file ftp_file.txt from the FTP server.

Copy code

    // Logon to the FTP server
    ftp_logon ("FTP", "URL=ftp://ftp.microsoft.com",
                LAST );

    // Get a file back from the FTP server
    ftp_get ("Get_Files", "SOURCE_PATH=/pub/for_jon/ftp_file.txt",
             "TARGET_PATH=f:/downloads/ftp_file.txt", "MODE=ASCII",
             LAST );

    // Logout from the FTP server
    ftp_logout();

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: