How to Program with the LEAD Raster FTP Object

The LEAD Raster FTP Object allows a user to create a connection with an FTP server, transfer files and bitmaps, perform remote file operations, perform remote directory operations and browse remote directories for files. The following topics provide a systematic approach to understanding how to program with the LEADTOOLS FTP methods.

Connecting and Disconnecting to the FTP Server

The first step in working with a FTP server is to use InetFtpConnect to connect to the desired FTP server. A user can connect with a user name and password, or as an "anonymous" user. To disconnect from the FTP server use the InetFtpDisconnect method.

File Manipulation

The user can store files on the FTP server via InetFtpSendFile. To get a file from the FTP server and store it on the local system, use the InetFtpGetFile method. In addition, a remote file on the server can be renamed using InetFtpRenameFile. Finally, InetFtpDeleteFile can delete a remote file on the server.

Directory Manipulation

The user can create directories on the FTP server via InetFtpCreateDir. To delete a directory from an FTP server, use the InetFtpDeleteDir method. InetFtpChangeDir changes the working directory on the FTP server. Finally, InetFtpGetCurrentDir retrieves the current directory for the specified FTP session.

Directory Browsing (Search results)

Any directory can be browsed on the FTP server. In addition, a file search can also be performed. Both can be implemented by calling InetFtpBrowseDir. The search results can be obtained from the FTPBrowse event. This event is triggered for every file that matches the search criterion given to InetFtpBrowseDir.

Uploading a Bitmap to an FTP server

The LEADTOOLS FTP Object supports uploading a LEAD bitmap. Use the InetFtpSendBitmap method to manage asynchronous uploading of a bitmap.