Ftp Open

This command opens a file on a remote FTP site. You can only have one remote file open at any one time for a single FTP session.

You must first create an FTP connection using the Ftp Connect, Ftp Connect2, Ftp ConnectFTPS, or Ftp ConnectSFTP command before using this command.

Note: This command is not supported on the Java Client.

Syntax

Ftp Open filename, [option], [response]

Synonyms

FTP OP

Parameters

The following table describes the parameters of the Ftp Open command:

Parameter Description
filename The name of the remote file to open. The file name can be specified with or without a full or relative path.
option Specifies the file and operation type. You cannot open a remote file for both reading and writing, so the options must reflect which operation is intended. See the following table.
response A variable that will be set to True if successful, or False if unsuccessful.

Values for option

Value Description
0 Read ASCII text (the default). Select this option only if the file is a readable ASCII file. This ensures the end-of-line characters are converted appropriately between local and remote file systems.
1 Read Binary.
2 Write ASCII text. Select this option only if the file is a readable ASCII file. This ensures the end-of-line characters are converted appropriately between local and remote file systems.
3 Write Binary.

Examples

The following example reads the contents of the people remote data file.

Ftp Open "people", 0, Response
If Response Then
MessageBox Response
Else
Ftp Read PeopleData
MessageBox PeopleData
Ftp Close
EndIf

Related Script Commands

Ftp Close, Ftp Connect, Ftp Connect2, Ftp ConnectFTPS, Ftp ConnectSFTP, Ftp Read, Ftp Write