ftp_get_ex
| FTP Functions (ftp) |
Gets a file from an FTP server for a specific session.
int ftp_get_ex( FTP *ppftp, char *transaction, <item list>, LAST );
Function objFTP.get_ex( ppftp as FTP, transaction as String, item_list as String, LAST) as Integer ' for VB Script
| ppftp | An FTP session identifier. |
| 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.
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_ex function gets the working directory on the FTP server for the specified session.
This function is for use with multiple sessions. For global sessions, use the ftp_get function, which does not take a session identifier argument.
Return Values
If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.
Parameterization
The values of keyword-value pairs can be parameterized. For example, "ALT={altParam}".
Example
In the following example, the ftp_get_ex function gets the file ftp_file.txt from the FTP server.
FTP pFTP;
// Login to the FTP server
ftp_logon_ex (&pFTP, "FTP", "URL=ftp://ftp.abc.com",
LAST );
// Get a file back from the FTP server.
ftp_get_ex (&pFTP, "Get_Files", "SOURCE_PATH=/pub/for_jon/ftp_file.txt",
"TARGET_PATH=f:/downloads/ftp_file.txt", "MODE=ASCII",
ENDITEM,
LAST );
// Logout from the FTP server
ftp_logout_ex(&pFTP);

