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: FileAction

   Products   Downloads   Sales   Support   About us
  VIT



        
 
Summary

Delete, get, put, append or rename file on server.

Description

The FileAction property accesses files in the current working directory of the FTP server. Files can be transferred to the server (put), downloaded to the local disk (get), appended, deleted or renamed.

Value Meaning
FILE_ACTION_ABORT Abort file action in progress.
FILE_ACTION_DELETE Delete file in current directory.
FILE_ACTION_GET Retrieve file from server.
FILE_ACTION_PUT Upload file to server.
FILE_ACTION_RENAME Rename file in current directory.
FILE_ACTION_APPEND Append to a file on the server.
FILE_ACTION_REMOTE Upload file on remote server to another remote server.
FILE_ACTION_REMOTE_APPEND Append file on remote server to another remote server

This property can be changed at run time only.

Before setting the FileAction property to FILE_ACTION_DELETE or FILE_ACTION_RENAME, the name of the file on which the operation should be performed must be assigned to the Target property. In case of the FILE_ACTION_RENAME action, the new name of the file must also be assigned to the NewName property.

Files can be transferred to and from the FTP server either directly or through events, depending on the setting of the TransferMode property. In direct mode, a FILE_ACTION_PUT operation transfers the local file specified with the LocalFile property to the remote file specified with the RemoteFile property and a FILE_ACTION_APPEND operation will append the contents of the local file specified with the LocalFile property to the remote file specified with the RemoteFile property. A FILE_ACTION_GET operation, in the direct mode, transfers the remote file specified with the RemoteFile property to the local file specified with the LocalFile property. This feature allows an application to transfer complete files of any size without doing any I/O itself. The LocalFile property must contain a fully qualified path name since there is no current local directory.

During a direct file transfer, one or more OnTransfer events will occur to notify the application of the status of the file transfer (number of bytes copied). The application can use this information to display the progress of the file transfer. This event will be fired only if the Notify property is set to True.

When a file is transferred through events, then one or more OnSend events (in case of a put or an append operation) or one or more OnReceive events (in case of a get operation) will be fired. An OnSend event asks the application to provide up to a maximum number of bytes of data, which are to be saved in the remote file. OnSend events are generated until the application indicates that there is no more data to send. An OnReceive event delivers a portion of the data from the remote file to the application. Event based file transfer allows an application to move data to and from storage other than the local disk, such as through DDE or the clipboard. For event based file transfer, the LocalFile property is ignored and can be left blank.

Files can be transferred from the FTP server to another FTP server via a FILE_ACTION_REMOTE operation. Use the FILE_ACTION_REMOTE_APPEND operation to append the contents of a file on the FTP server, to a file on another FTP server. Before setting the FileAction property to FILE_ACTION_REMOTE or FILE_ACTION_REMOTE_APPEND, set the LocalFile property to the file on the FTP server and set the RemoteFile property to the file name on the other FTP server. The RemoteId property must be set to the connection id of the other FTP client involved in the remote to remote file transfer.

If a file should be transferred in its original format without any filtering, then the TransferType property must be set to TRANSFER_TYPE_BINARY. If the transfer type is set to TRANSFER_TYPE_ASCII, then carriage return and line feed pairs are converted to line feeds during a put operation and line feeds are converted to carriage return and line feed pairs during a get operation. The ASCII mode conversion is normally used to convert text files to a format suitable for text editors on the destination machine.

Setting the FileAction property to FILE_ACTION_ABORT will abort any get, put or append operation in progress. This is usually done during an OnSend or OnReceive event to make sure that no further such events will occur.

The value of the LastResult property can be checked to determine if the action has been performed successfully.

The AbortFile, DeleteFile, GetFile, PutFile, RenameFile, AppendFile, Remote and RemoteAppend methods accomplish the same as the above actions. Please check the reference pages of these methods for more detailed information on their usage.

There is no default value for this property.

Example

FTPClient.RemoteFile = "test.exe"
FTPClient.LocalFile = "c:\test.exe"
FTPClient.FileAction = FILE_ACTION_GET

Note

If you are writing a new application it is recommended to use the corresponding methods for these actions instead.



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.


  8/29/2008   Legal notices | PRIVACY Policy | Networking News |