Programming with Reflection

image\rwnprg32.gif FTPSendFile method


Syntax object.FTPSendFile LocalFile, RemoteFile, [TransferType], [IfFileExists], [Before], [Since], [Exclude]



Transfers one or more files from the PC to the host using FTP file transfer protocol. Use FTPStartServer to connect to the host server before using this method. Use FTPStopServer to disconnect from the host server after file transfer is complete. Click the Example link below to see an example.


LocalFile Argument type: String
Specifies a local file or files to be transferred. This string can contain drive and path information and can contain PC wildcard characters (to transfer multiple files).

RemoteFile Argument type: String
Specifies a host file name. This string cannot contain wildcard characters. If this string is an empty string (""), each local file name transferred is used to generate a host file name.

 Note: For connections to VMS hosts, fully qualified path names are not supported. For these hosts, use FTPSetCurrentHostDirectory to specify a server location.

TransferType Argument type: Enumeration

 Specifies ASCII file transfer. If FTPTranslateCharacters is True, Reflection applies the ASCII File Translation options (as specified on the Translation tab in the File Transfer Setup dialog box) to the data in the file as it is transferred.


 Specifies binary file transfer. Data in the file is not translated as it is transferred.


 File transfer type is determined by the file extension. Use these properties to determine which file extensions are linked to which transfer type:




IfFileExists Argument type: Enumeration
Specifies what to do if the file already exists on the host. The default is rcCancel. The possible values are:


 Prompts the user to specify what should be done.


 Stops the transfer.


 Performs the transfer only if the local file is newer than the host file.


 Deletes (overwrites) the existing file.


 Renames the file being transferred. The existing file retains the original name. The last three characters of the file being transferred are changed to 001. If such a file already exists, the file's name is changed to 002, and so on, up to 999.


 Skips the file (the transfer does not take place, but no error results).

Before Argument Type: Date/Time
Specifies a date and time. Only PC files created or modified before the specified date and time are transferred.

Since Argument Type: Date/Time
Specifies a date and time. Only PC files created or modified after the specified date and time are transferred.

Exclude Argument Type: String
Specifies one or more files to be excluded from a wildcard transfer. The file names can include wildcards.



image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command