Share this page

# ftp_put_ex

FTP Functions (ftp)

Puts a file on an FTP server for a specific session.

    int ftp_put_ex ( FTP *ppftp, char *transaction, <item list>, LAST );

    Function objFTP.put_ex( ppftp as FTP, transaction as String, item_list as String, LAST ) as Integer     `for VB , 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. SOURCE_PATH - The file to upload to the FTP server. MSOURCE_PATH - The files to upload to the FTP server, using wildcards to specify multiple files. If wildcards are not specified, all the files in the MSOURCE_PATH are uploaded. 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 place the file. if (M)SOURCE_PATH is specified, but TARGET_PATH is not specified, the file is stored in the root directory of the FTP server, with the original file name. MODE - (optional) Retrieval mode ASCII or BINARY (default). PASSIVE - (optional) Sets the communication protocol to Passive Mode FTP. To enable, pass "PASSIVE=TRUE". ENDITEM - Marks the end of the item list. (no quotes)
LAST | A marker indication the end of the argument list.

The ftp_put_ex function uploads a file to the FTP server on the specified session.

If the source prefix is "ftpfile_", during test run, the file is searched for under the data\ftp.db directory under the script directory. If not found, the data directory and then the script directory are searched.

This function is for use with multiple sessions. For global sessions, use the ftp_put function, which leaves out the 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_put_ex function places the file ftp_file.txt in the directory /testFiles.

Copy code

    FTP pFTP;
    // Login to the FTP server
    ftp_logon_ex (&pFTP, "FTP", "URL=ftp://ftp.abc.com",LAST );

    // Send the file "ftp_file.txt" to the /testFiles directory.
    ftp_put_ex (&pFTP, "Ftp_Put", "PATH=/testFiles",LAST );

    // Logout from the FTP server
    ftp_logout_ex(&pFTP);

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: