Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Distinct VIT: Ftp Client: Usage

   Products   Downloads   Sales   Support   About us
  VIT
 



        
 
See the section entitled "Using Distinct ActiveX controls in various environments" on how to add the control to your project.

After placing an FTP Client ActiveX control into a form, some properties can be set at design time. The Port property defaults to 21, which is the most commonly used port number for FTP servers. Some properties, such as User, Password and Account, are usually not set at design time for security reasons. Instead, they are set at run time from information entered by the user. Please check the reference pages of these properties for more details. Certain configuration options controlling the type of directory listing and the type of file transfer may never change in a session and need therefore only be set once at design time.

The Host property is usually set at run time right before a session is established. This allows the application to request the host name or internet address of the FTP server from the user. If an application will always connect to the same host, then the Host property can also be set at design time to minimize user interaction.

Some properties (for example the Action, DirAction and FileAction properties) can only be accessed at run time. To establish an FTP session, the value of the Action property must be set to ACTION_CONNECT (or call the Connect method). The Host, Port, User and Password properties are required to log into the server (some servers also require the Account property). If the connection can be established, the OnConnect event will occur before the next line of code is reached. At this point, the user is logged into the FTP server and can now access remote files and directories.

For some users, the local machine is located on a different subnet than the remote host and the only way of communication is through a firewall. If this is the case, then the built-in firewall support of the FTP Client ActiveX control can be used to establish an FTP session via a firewall by setting the Action property to ACTION_FW_CONNECT (or by calling the FwConnect method). In addition to setting the properties for a regular FTP session, the FirewallServer, FirewallPort, FwAddrType, FwAuthMethods, FwUsername and FwPassword properties must also be set before setting the Action property to ACTION_FW_CONNECT. If the connection can be established, the OnConnect event will occur before the next line of code is reached. At this point, the user is logged into the FTP server and can now access remote files and directories as with a regular FTP connection.

The current working directory on the server can be determined by reading the value of the CurrentDir property. The DirAction property is used to move around in the remote directory structure. This property can change the working directory, list its contents and create, delete or rename subdirectories of the current directory. The contents of a remote directory can be listed in short (only the file or subdirectory name) or long (names and attributes) format depending on the setting of the ListType property.

Files in the remote directory can be manipulated with the FileAction property. Files can be uploaded to the server (put operation), downloaded to the local disk (get operation), deleted or renamed. The transfer of files can either be event driven or can be done directly to or from the local disk. During an event driven file transfer, the FTP Client control fires events whenever a section of a file has been received or another section of a file can be sent. This allows the application to transfer data to and from storage other than the local disk, such as through DDE or the clipboard. A direct file transfer copies files without requiring the application to do any I/O. The TransferMode property controls whether a file transfer is event driven or direct.

Files in the remote directory can also be transferred to another remote directory by setting the FileAction property to FILE_ACTION_REMOTE (or the Remote method) or to FILE_ACTION_REMOTE_APPEND (or the RemoteAppend method). Before setting the Action property, set the RemoteId property to the connection id of the remote machine.

During a direct file based transfer, one or more OnTransfer event will occur to inform the application of the status of the file transfer. This information is useful if the application wishes to display the progress of the file transfer.

Some applications may want to request the FTP Server to listen for a data port and wait for the connection rather than initiate the process when a data transfer request comes in. To achieve this, set the Passive property to True before a file transfer is initiated.

Any action or command in progress can be aborted by setting the Action property to ACTION_CANCEL (or by calling the Cancel method).

Once a connection is no longer needed, the Action property must be set to ACTION_DISCONNECT (or call the Disconnect method). After the session is disconnected, the OnClose event will occur before the next line of code is reached. Applications must disconnect any connected session before terminating.



Browse FAQ

Related Products
Mail Objects

Recommended Add-On
Network Monitor,
Protocol Analyzer


Raves
"The night before I went on summer holiday we had to make some 'last minute' configuration changes to approx. 300 routers, a tedious job to do manually with telnet. We went along with MS Excel containing a list of IP-adresses to the routers, and the VIT telnet-component. One hour later the VBA-application (small is beautiful) was working, and after another hour all of our routers were updated with the new configuration. I just say a big "Thanks" to you all for a good sleep that night."
Eirik Brendholen, Ergo Integration AS

"We conducted a test session to compare the performance of similar products, and Distinct's product was better!" [more]
Dr. Shyam Sunder, Carnegie Mellon University

"Together with Distinct, we were able to offer our users an ideal soution to enabling them to connect to Yahoo! Pager, and to do so both quickly and reliably." [more]
Brian Park,
Producer of Yahoo! Pager, Yahoo! Inc.


  10/12/2008   Legal notices | PRIVACY Policy | Networking News |