Monster FTP

Monster FTP is a set of native Delphi component (VCL) which implement the client FTP protocol (RFC959) and provide a user friendly interface for it.

It includes five components so far:

Com-1.bmp (534 bytes) | TMFtp
 | TMFtpSearch
Com-2.bmp (534 bytes) | TMFtpListView
Com-3.bmp (534 bytes) | TMFtpMessenger
Com-4.bmp (534 bytes) | TMFtpTreeView

See Also:

  • History of Monster FTP
  • What's going to do?
  • Homepage of Monster FTP
Mail List:
Powered by ListBot


TMFtp

The component adds FTP functionality to your Delphi or C++ Builder applications.

Unit

ftp

Properties

Account | Asynchronous | Busy | BytesTransferred
Cache | CacheExpire | Connected | Directories
Error | FileMask | Files | InitalDirectory
LastReply | NoopInterval | Passive | Password
Port | ProxyPassword | ProxyPort | ProxyServer
ProxyType | ProxyUsername | Retries | RetryInterval
Server | ServerType | StartPoint | Success
SupportResume | TimeOut | TransferMode | TransferTime
URL | Username | Version |

Methods

Abort | BuildFileList | ChangeDirectory | ChangeToPerentDirectory
CreateDirectory | DeleteDirectory | DeleteFile | DirectoryExists
FileExists | FileSetAttr | GetFile | IssueCommand
LoadIndexFile | Login | MoveFile | PutFile
Quit | Refresh | RenameFile | ResolveLinks
TransferFile |  |  |

Events

OnAborted | OnDirectoryChanged | OnDirectoryCreated | OnDirectoryDeleted
OnFileDeleted | OnFileFound | OnFileReceived | OnFileRenamed
OnFileStored | OnFileTransferred | OnFtpBusy | OnFtpError
OnFtpInfo | OnFtpNeedInfo | OnFtpQuit | OnFtpReady
OnIndexFileReceived | OnListingDone | OnLoggedIn | OnResolvedLinks


TMFtpSearch

The component make your Delphi or C++ Builder applications has ability to search ftp file on internet..

Unit

ftpsearch

Properties

Busy | Cache | Filename | Files
FromDate | MaxHit | MaxMatch | MaxSize
MinSize | Proxy | SearchType | Server
ToDate |  |  |

Methods

Search

Events

OnSearchInfo


TMFtpListView

A listview that displays a list of files and folders which exist on server

Unit

ftplistview

Properties

Accept | Ascending | Client | Filter
SelectedDirectories | SelectedFiles | SortType | WebStyle

Methods

InvertSelection IsDirectory Refresh SelectAll

Events

OnFileDropped


TMFtpMessenger

A read-only rich text box that displays commands sent by specified component and responses from server.

Unit

ftpmsg

Properties

AutoScroll Client Style

Events


TMFtpTreeView

A treeview that displays "site map" of server

Unit

ftptreeview

Properties

Accept Client Preload WebStyle

Methods

CollapseAll ExpandAll

Events

OnFileDropped


Relative Information

  • Homepage of Monster FTP
  • Relative Documents
  • Other Delphi native FTP client component


Relative Documents

If you want to know more about the File Transfer Protocol, you'd better read following articles first:

RFC 959: File Transfer Protocol

RFC 1123: Requirements for Internet Hosts -- Application and Support

RFC 2228: FTP Security Extensions

RFC 2389: Feature negotiation mechanism for the File Transfer Protocol

RFC 2428: FTP Extensions for IPv6 and NATs

RFC 2577: FTP Security Considerations

FTPEXT Draft: Extensions to FTP


Other Delphi native FTP client component

You can have another choice on Delphi native FTP client component:

Name | Author
BTDragDrop FTP | Michael Justin
Internet Component Suite | Francois Piette
Freenet | Tony BenBrahim
TCP/IP Component Pack | Andreas Horstemeier
TCPIP Suite | Agustin Lopez

All of them are free!


Additional Routines for Monster FTP

Routines

CleanCache


Contributors

This is a partial list of contributors to Monster FTP, if you have also contributed just send me a mail and I will add your name to the list.

Name | Contribution
Tony BenBrahim | I borrowed much code from his great components TStarFTP & TStarSock. Without his code, there is no Monster FTP today.
Antonio Carlos Ribeiro Faria | Provide Portuguese message file
Brad Stowers | Property FileMask, method ChangeToParentDirectory & upload bug fix
Cesar | Suggestion & another version of Portuguese message file
Chris Godwin | Bug report (TMFtpTreeView) & beta testing
Dennis Gurock | Provide German message file
Etsu Fukura | Memory leak bug fix
Hector Vega Arvide | Bug report (proxy)
Jim Sullivan | Memory leak bug fix
Kaufman Alex | Bug report, beta testing & provide French message file
Kostya | Bug report, suggestion & provide updated French message file
Martin Masci | Provide Italian message file
mEga warrior | Suggestion, bug report/fix & beta testing, FXP code
Tomasz Waraksa | Provide Polish message file
Sub & Vladimir L. Olovyannikov | Compatibility problem fix


Easily Parsed LIST Format

Easily Parsed LIST Format (EPLF)

    D. J. Bernstein, djb@pobox.com 04/13/97

1. Introduction

The File Transfer Protocol (FTP) supports two commands that list files: NLST and LIST. The NLST response is easy to parse but provides very little information. The LIST response provides more information, but in a format that varies from system to system. The most common LIST formats are undocumented and impossible to parse reliably.

This document defines Easily Parsed LIST Format (EPLF), a format for the LIST response that is usable by humans yet easy for programs to handle. This format is supported by anonftpd, a secure FTP server.

One visible advantage of EPLF is that a browser can easily display dates in the viewer's time zone and native language. EPLF also makes it straightforward for an indexing program to automatically traverse an FTP area and for a mirroring program to avoid downloading the same file twice.

EPLF also corrects a design flaw in FTP's handling of LIST arguments. An EPLF server must respond to ``LIST filename'' with information about that file and no others, even if that file is a directory. A client that wants an EPLF list of the contents of a directory must first CWD to that directory. A client that merely wants a list of file names in a different directory may use NLST.

In this document, a string of 8-bit bytes may be written in two different forms: as a series of hexadecimal numbers between angle brackets, or as a sequence of ASCII characters between double quotes. For example, <68 65 6c 6c 6f 20 77 6f 72 6c 64 21> is a string of length 12; it is the same as the string "hello world!".

2. Format

An EPLF response to LIST is a series of lines, each line specifying a different file. Each line begins with "+", continues with a series of facts about the file, and ends with <09> followed by the file name. Each fact is zero or more bytes of information, terminated by "," and not containing <09>. There are several possible facts, each of which appears at most once, in any order:

"r"

If this file name is supplied in a RETR command, the RETR should succeed. The server must supply this fact unless it is aware of file type problems, permission problems, or other reasons that RETR will fail. The presence of "r" does not guarantee success: for example, the file may be removed or renamed, or the RETR may suffer a temporary failure.

"/"

If this file name is supplied in a CWD command, the CWD should succeed. As with "r", the server must supply this fact unless it is aware of reasons that CWD will fail. The presence of "/" does not guarantee success.

"i"[ident]

This file has identifier [ident]. [ident] is a sequence of bytes not including "," or <09>. If two files on the same FTP server (not necessarily in the same LIST response) have the same [ident], those files have the same contents; a successful RETR of each file should produce the same results, and a successful CWD to each file should lead to the same working directory. (Under UNIX, for example, [dev].[ino] could be used as [ident], where [dev] and [ino] are the device number and inode number of the file.)

"s"[size]

The size of this file is [size]. [size] is a sequence of ASCII digits specifying a number. If the file is retrieved in TYPE I and is not modified, it will contain exactly [size] bytes. This fact should not be supplied if "r" is not supplied.

"m"[time]

This file was last modified at [time]. [time] is a sequence of ASCII digits specifying a number of seconds, real time, since the beginning of 1970 GMT. This fact cannot be used for files modified before 1970 GMT.

Further facts may be defined in the future. Pieces of the fact-space beginning with "x" will be parcelled out to organizations that would like to define their own facts. Facts beginning with "X" are reserved for experimental use.

All facts other than "/" and "r" are optional. Any statement of adherence to EPLF by a server FTP implementation must include a list of facts supported by that implementation other than "/" and "r". The server is under no obligation to ensure that LISTs in different directories produce disjoint lists of targets. For example, some servers may list a special ".." name that refers to the parent directory, or a "/" name that refers to the top directory. To avoid loops, a client attempting to traverse the FTP area must notice that the identifiers of these directories are the same as identifiers of directories already traversed.

The server is also under no obligation to list all possible targets of RETR or CWD in a LIST command. Some servers may avoid listing special names such as ".." or "/". A client that wishes to return to a directory must use PWD and record the reply rather than relying on any useful meaning of CDUP, CWD .., or CWD /.

Operating systems support a wide variety of means for obtaining the contents of a file from its name. For example, many systems support symbolic links: if ONE is a link to TWO, any reference to ONE is first replaced by a reference to TWO. Such information is irrelevant to FTP and is not displayed by any of the above facts. (Under UNIX this means that the server should use stat(), not lstat().)

Servers are permitted to use arbitrary characters in file names, except for <0a> and <0d>. Beware that the characters <00>, <09>, <20>, and <ff> cause all sorts of trouble, ranging from inadequacies in the syntax of FTP commands to misinterpretation by some clients.

3. Examples

Here is a typical EPLF response:

"+i8388621.48594,m825718503,r,s280," <09> "djb.html" <0d 0a>
"+i8388621.50690,m824255907,/," <09> "514" <0d 0a>
"+i8388621.48598,m824253270,r,s612," <09> "514.html" <0d 0a>

A typical EPLF-ignorant client will show the response to the user:

ftp> dir

200 Okay.
150 I'm looking through the directory. Trying to connect...

+i8388621.48594,m825718503,r,s280, djb.html
+i8388621.50690,m824255907,/, 514
+i8388621.48598,m824253270,r,s612, 514.html

226 Finished transferring 127 bytes.

ftp>

A more sophisticated client (in the Pacific timezone) might instead display the following human-readable listing:

Tue Feb 13 15:58:27 1996 514/
612 bytes Tue Feb 13 15:14:30 1996 514.html
280 bytes Fri Mar 1 14:15:03 1996 djb.html

4. Sample code

The following C function takes a pointer to a string containing one line of an EPLF response. It assumes that the original response did not contain <00>, and that the trailing <0d 0a> has been replaced by <00>. It returns a pointer to the filename, or 0 if the line does not appear to be an EPLF response.

char *eplf_name(char *line)
{
    if (*line != 43) return    0;
    while (*line) if (*line++ == 9) return line;
    return 0;
}
The following C function takes a pointer as above, and prints a human-readable listing as shown in section 3. It assumes that the local character set is ASCII, that file modification times fit into a local time_t, and that file sizes fit into a local unsigned long. It also assumes that time_t is interpreted as a number of seconds since the beginning of 1970 GMT. (A more portable function could use mktime() to discover the time_t representation of 1970 GMT.) Note that its output is not machine-readable, since the file name might contain the local newline sequence.

#include <time.h>
int eplf_readable(char *line)
{
   int flagcwd = 0;
   int flagsize = 0;
   time_t when = 0;
   unsigned long size;
   if (*line++ != '+') return 0;
   while (*line)
      switch (*line) {
         case '\t':
            if (flagsize) printf("%10lu bytes ",size); else printf(" ");
            if (when) printf("%24.24s",ctime(&when)); else printf(" ");
            printf(" %s%s\n",line + 1,flagcwd ? "/" : "");
            return 1;
         case 's':
            flagsize = 1; size = 0;
            while (*++line && (*line != ',')) size = size * 10 + (*line - '0');
            break;
         case 'm':
            while (*++line && (*line != ','))
               when = when * 10 + (*line - '0');
            break;
         case '/':
            flagcwd = 1;
         default:
            while (*line) if (*line++ == ',') break;
      }

   return 0;
}

5. Acknowledgments

Thanks to Scott Schwartz for pointing out that "i"[ident] was originally overspecified. Thanks to Benjamin Riefenstahl for several helpful suggestions.


Event OnAborted

Occurs when operation aborted

property OnAborted: TNotifyEvent;

Applied to

TMFtp


Event OnBusy

Occurs when mftp getting to do something

property OnBusy: TNotifyEvent;

Applied to

TMFtp


Event OnDirectoryChanged

Occurs when directory changed

property OnDirectoryChanged: TNotifyEvent;

Applied to

TMFtp


Event OnDirectoryDeleted

Occurs when directory removed from server

property OnDirectoryDeleted: TNotifyEvent;

Applied to

TMFtp


Event OnFileDeleted

Occurs when file removed from server

property OnFileDeleted: TNotifyEvent;

Applied to

TMFtp


Event OnFileFound

Occurs when mftp detected errors

(please see ftpdata.pas for the declaration of MFtpFileInfo)
type TMFtpFileFoundEvent = procedure (Sender: TObject; FileFound: MFtpFileInfo; Location: String; Directory: Boolean) of Object;

property OnFileFound: TMFtpFileFoundEvent;

Applied to

TMFtp

Example

var ZipFileList: TStringList;

procedure TForm1.MyFtpFileFound;
begin
if not Directory then { make sure the file found is not directory }
begin
with FileFound do
begin
if LowerCase(Copy(Filename, Length(Filename) - 4)) = '.zip' then
ZipFileList.Add(Location + Filename);
end;
 end;
end;


Event OnFileDropped

Occurs when there is any file dropped on

property OnFileDropped: TNotifyEvent;

Applied to

TMFtpListView, TMFtpTreeView

Description

This event occurs if property Accept set true.


Event OnFileRenamed

Occurs when rename or move operation finished

property OnFileRenamed: TNotifyEvent;

Applied to

TMFtp


Event OnFileTransferred

Occurs when file transferred to destination

property OnFileTransferred: TNotifyEvent;

Applied to

TMFtp


Event OnFtpError

Occurs when mftp detected errors

(please see ftp.pas for the declaration of FtpError)
type TMFtpErrorEvent = procedure (Sender: TObject; error: FtpError; addinfo: String) of Object;

property OnFtpError: TMFtpErrorEvent;

Applied to

TMFtp


Event OnFtpInfo

Occurs when there is any information that received by component

(please see ftp.pas for the declaration of FtpInfo)
type TMFtpInfoEvent = procedure (Sender: TObject; info: FtpInfo; addinfo: String) of Object;

property OnFtpInfo: TMFtpInfoEvent;

Applied to

TMFtp

Example

procedure TForm1.MyFtpInfo;
var Speed: Extended;
begin
case info of
 { connection status }
ftpResolvingAddress: StatusPanel.SimpleText := 'Resolving ' + addinfo;
ftpAddressResolved: StatusPanel.SimpleText := 'Connected to ' + addinfo;
ftpServerConnected: StatusPanel.SimpleText := 'Connected to ' + addinfo;
ftpServerDisconnected: StatusPanel.SimpleText := 'Disconnected';

{ transfer status }
ftpDataTrace:
begin
with MyFtp do
begin
if TransferTime > 0 then
begin
Speed := BytesTransferred / (TransferTime / 1000) / 1024;
StatusPanel.SimpleText := FormatFloat('#,##', BytesTransferred) + ' bytes
transferred,' + FormatFloat('#,##0.00', Speed) +
' KB per second';
end
else
 begin
StatusPanel.SimpleText := FormatFloat('#,##', BytesTransferred) +
' bytes transferred';
end;
end;
end;


Event OnFtpQuit

Occurs when mftp quitted and disconnected from the server

property OnFtpQuit: TNotifyEvent;

Applied to

TMFtp


Event OnIndexFileReceived

Occurs when specified index file received and parsed

property OnIndexFileReceived: TNotifyEvent;

Applied to

TMFtp


Event OnListingDone

Occurs when directory/file listing received and parsed

property OnListingDone: TNotifyEvent;

Applied to

TMFtp


Event OnLoggedIn

Occurs when mftp logged into the server

property OnLoggedIn: TNotifyEvent;

Applied to

TMFtp

Description

Using property URL to log in server does not caused the event.


Event OnDirectoryCreated

Occurs when directory created

property OnDirectoryCreated: TNotifyEvent;

Applied to

TMFtp


Event OnMessageShow

Occurs when there is any information that being showed by component

(please see ftp.pas for the declaration of FtpInfo)
type TMessengerShowEvent = procedure (Sender: TObject; info: FtpInfo; var Show: Boolean) of Object;

property OnMessageShow: TMessengerShowEvent;

Applied to

TMFtp


Event OnErrorShow

Occurs when there is any error message that being showed by component

(please see ftp.pas for the declaration of FtpError)
type TMessengerShowEventE = procedure (Sender: TObject; error: FtpError; var Show: Boolean) of Object;

property OnErrorShow: TMessengerShowEventE;

Applied to

TMFtp


Event OnNeedInfo

Occurs when there is any information that needed by component

type TMFtpInfoNeeded = (niAccount, niHost, niLocalFile, niOverwrite, niPassword, niUser);
type TMFtpInfoNeededEvent = procedure (Sender: TObject; need: TMFtpInfoNeeded; var Value: String) of Object;

property OnFtpNeedInfo: TMFtpInfoNeededEvent;

Applied to

TMFtp

Example

procedure TForm1.MyFtpNeedInfo;
begin
case need of
 { set default account, username and password }
 niAccount: Value := 'guest';
niUsername: Value := 'anonymous';
niPassword: Value := 'guest@microsoft.com';

{ determine the local name of the file being downloaded }
niLocalFile:
begin
 with SaveDialog1 do
 begin
 Filter := 'All Files|*.*';
Filename := Value;
if Execute then Value := Filename;
end;
end;

{ determine whether the file will be overwritten }
niOverwrite:
begin
with ConfirmForm do
 begin
ButtonResume := MFtp1.SupportResume;

ShowModal;

case Tag of
 0: Value := 'Cancel'; // Cancel current download/upload operation
 1: Value := 'Overwrite'; // Overwrite the file
 2: Value := 'Resume'; // Resume broken download/upload
 end;
end;
end;
 end;
end;


Event OnReady

Occurs when mftp finished doing something

property OnReady: TNotifyEvent;

Applied to

TMFtp


Event OnFileReceived

Occurs when file downloaded from server

property OnFileReceived: TNotifyEvent;

Applied to

TMFtp


Event OnResolvedLinks

Occurs when symbol links resolved as files

property OnResolvedLinks: TNotifyEvent;

Applied to

TMFtp


Event OnSearchInfo

Occurs when there is any information that received by component

type  TMFtpSearchInfo = (searchStart, SearchDone, SearchFileFound);
type  TMFtpSearchInfoEvent =  procedure (Sender: TObject; info: SearchInfo; addinfo: String)
 of Object;

property OnSearchInfo: TMFtpSearchInfoEvent;

Applied to

TMFtpSearch


Event OnFileStored

Occurs when file put on server

property OnFileStored: TNotifyEvent;

Applied to

TMFtp


History of Monster FTP

0.4.7 (April 10, 2001)

  1. Added property Banner
  2. Added property MultiThreaded for multi threaded purpose
  3. Added support for some ftp servers which disobey RFC documents
  4. Fixed a bug in handling with FD_CLOSE message
  5. Method BuildFileList improved, and bug fixed as well
  6. Minor bug fixes

0.4.6 (August 19, 2000)

  1. Added Polish and Italian resource file
  2. Fixed a bug in generating directory nodes for TMFtpTreeview
  3. Memory leak bug fixed
  4. No longer use "REST 1" when testing server resume ability to avoid "first byte less" bug

0.4.5 (May 22, 2000)

  1. TMFtpListview supports column-sorting (click column header to sort items of listview)
  2. TMFtpListview supports file-filter
  3. Misc changes

0.4.4 (May 10, 2000)

  1. Added property AutoScroll to TMFtpMessenger
  2. Fixed a bug which may cause I/O exception
  3. German resource file now added
  4. Updated French resource file

0.4.3 (March 13, 2000)

  1. Fixed a bug that TMFtpTreeView doesn't display right icon on Windows 2000

0.4.2 (January 2, 2000)

  1. Fixed a bug in download/uploading file that named aaa(bbb).txt etc.
  2. Portuguese resource file now added
  3. TMFtpSearch component now uses thread (will it be effective?)

0.4.1 (October 1, 1999)

  1. Adapted for Delphi 5
  2. Fixed a bug that mftp does not upload files properly if the site doesn't support command REST
  3. German resource file now added
  4. Improved TMFtpSearch component

0.4.0 (August 23, 1999)

  1. Added a new component TMFtpSearch for ftp searching
  2. Added property StartPoint (it is useful to make download/upload progress bar)
  3. Adapted for C++ Builder 4
  4. Changed the name of component from "TMFtpMessager" to "TMFtpMessenger"
  5. Fixed a bug in parsing filename with "extra" space like "a b"
  6. FTP.PAS has been rewritten for easier maintenance (unfortunately, mftp will no longer work with D3 & CB3 :-( )
  7. Improved method IssueCommand
  8. Localization (English, French, Simplified Chinese)
  9. Memory leak bug fixed
  10. Method DeleteDirectory now tries to remove unused cache file after directory removed from server
  11. Optimized displaying for TMFtpListView
  12. Optimized multi file operation
  13. Properties TimeOutArp and TimeOutConnect are combined into property TimeOut
  14. Removed "Parent Directory" item from TMFtpListView (you can can still enable it by modifying mftp.inc)
  15. Supports server to server transfer

There are many other enhances that I've forgotten ...

0.3.4 (December 23, 1998)

  1. Supports URLs which contains unique characters like: ftp://server.com/%ffabc/

0.3.3 (November 8, 1998)

  1. Just bug fixes

0.3.2 (October 1, 1998)

  1. Added method LoadIndexFile
  2. Added method ResloveSymbolLink
  3. Again fixed many bugs in processing URL property
  4. Minor bug fixes
  5. Some optimization
  6. Supports a new proxy type: proxyHost, proxyHostUser

0.3.1 (August 23, 1998)

  1. Added event OnAborted
  2. Added support for NetTerm FTPD, FTP Serv-U(no auto detect), Net Presenz(no auto detect)
  3. Adapted for C++ Builder 3
  4. Fixed a bug in sorting Date/Time (Year 2000 compatible)
  5. Fixed many bugs in processing URL property
  6. Replaced method StopTransfer with Abort
  7. Replaced property WebUI with HotTrack/HotTrackStyle

0.3.0 (August 4, 1998)

  1. Added three new components: TMFtpListView, TMFtpTreeView, TMFtpMessager
  2. Added property CacheExpire
  3. A small bug in ParseListingLine is fixed
  4. Checks file size before upload/download operations by sending SIZE command to server (although Microsoft IIS doesn't support it)
  5. Codes cleaned up in ftpsock.pas
  6. Minor bug fixes
  7. ParseListingLine now supports EPLF(Easily Parsed List Format)
  8. Adapted for Delphi 4
  9. Supports REPUT (resume broken uploads)
  10. "Custom" property is removed for compatible problem

0.2.4 (May 15, 1998)

  1. Proxy connection now works properly
  2. The login method no longer stuck after a connection with wrong parameters

0.2.3 (April 25, 1998)

  1. Added "Custom" property (like (Custom) in Visual Basic)
  2. Date/Time sorting is optimized
  3. Fixed a bug in PutFile method
  4. Fixed "Read beyond file" error

0.2.2 (April 19, 1998)

  1. Added procedure SortLists (located in ftpdata.pas) to sort lists
  2. Changed SupportResume from private variable to run-time only property
  3. Minor bug fixes
  4. TYPE optimization is implemented

0.2.1 (April 12, 1998)

  1. Added property MoveFile
  2. Added properties ProxyPort, ProxyUsername, ProxyPassword
  3. Fixed a bug in SetupDataPort
  4. Supports two more proxy types: proxyOpen (OPEN site), proxySite (SITE site, requires username and password for proxy)

0.2.0 (April 4, 1998)

  1. Supports directory information caching
  2. Supports URL mode (ftp://username:password@server:port/...)
  3. Minor bug fixes

0.1.1 (March 14, 1998)

  1. Added ChangeToParentDirectory method
  2. Added FileMask property
  3. Fixed that ParseListingLine doesn't work properly sometimes
  4. Fixed a big bug in PutFile that caused it cannot work under passive mode

0.1.0 (March 6, 1998, my 16th birthday)

  1. First public release


Method Abort

Terminate the execution of current operation

procedure Abort;

Applied to

TMFtp

Description

Only one of the following operation can be terminated:

  1. Connecting to or logging into remote server
  2. File downloading/uploading
  3. Grabbing remote file listing
  4. Multi file operation

Event OnAborted will be fired if current operation terminated.


Method BuildFileList

Look for files over the directory specified by paramter StartDir and its subdirectories.

procedure BuildFileList(StartDir: String);

Applied to

TMFtp

Description

Event OnFileFound will be fired if a file or directory found.


Method CollapseAll

Collapses all expanded items

procedure CollapseAll;

Applied to

TMFtpTreeView


Method ChangeDirectory

Changes current directory to specified directory

procedure ChangeDirectory(DirName: String);

Applied to

TMFtp

Description

Event OnDirectoryChanged will be fired when the directory changed.


Method ChangeToParentDirectory

Changes current directory to its parent directory.

procedure ChangeToParentDirectory;

Applied to

TMFtp

Description

Event OnDirectoryChanged will be fired when the directory changed.


Method DeleteDirectory

Removes specified directory from server

procedure DeleteDirectory(DirName: String);

Applied to

TMFtp

Description

Event OnDirectoryDeleted will be fired when the directory deleted.


Method DirectoryExists

Indicates whether specified directory is available on server

function DirectoryExists(DirName: String): Integer;

Applied to

TMFtp

Description

If specified directory is found, its position is returned, otherwise the function returns -1.


Method DeleteFile

Removes specified file from server

procedure DeleteFile(Filename: String);

Applied to

TMFtp

Description

Event OnFileDeleted will be fired when the file deleted.


Method ExpandAll

Expands all collapsed items

procedure ExpandAll;

Applied to

TMFtpTreeView


Method FileExists

Indicates whether specified file is available on server

function FileExists(Filename: String): Integer;

Applied to

TMFtp

Description

If specified file is found, its position is returned, otherwise the function returns -1.


Method FileSetAttr

Changes the attributes of specified file

procedure FileSetAttr(filename: String; OwnerRead, OwnerWrite, OwnerExecute, GroupRead, GroupWrite, GroupExecute, PublicRead, PublicWrite, PublicExecute: Boolean);

Applied to

TMFtp

Description

Not all kinds of FTP server supports this feature.


Method GetFile

Downloads specified file from server

procedure GetFile(RemoteFile, LocalFile: String);

Applied to

TMFtp

Description

If the specified file already exists on your computer, event OnFtpNeedInfo will be fired to determine whether the file will be overwritten.


Method Refresh

Indicates whether specified item is directory

function IsDirectory(LI: TListItem): Boolean;

Applied to

TMFtpListView


Method InvertSelection

Reverses which items are selected and which are not in listview

procedure InvertSelection;

Applied to

TMFtpListView


Method IssueCommand

Sends custom commands to server

type TFtpProc = procedure (Line: String) of Object;
procedure IssueCommand(Command: String; OnDone: TFtpProc);

Applied to

TMFtp

Description

Event handler specified by OnDone parameter will be fired after the command executed on server. Parameter OnDone can be omitted or set to nil and the component will process server's reply itself.


Method LoadIndexFile

Downloads specified index file and fill in the description field for properties Directories and Files

procedure LoadIndexFile(Filename: String);

Applied to

TMFtp

Description

Event OnIndexFileReceived will be fired when the index file is downloaded and parsed. Of course, the associate listview control will also refresh at the same time.

Example

with MFtp1 do
begin
 if FileExists('index.txt') then LoadIndexFile('index.txt');
end;


Method Login

Enables a connection to specified FTP server

procedure Login;

Applied to

TMFtp

Description

After called this method, the component will automatically connect to the specified server and send (get) necessary information to (from) server. Event OnLoggedIn will be fired when the login operation completed.

Example

with MFtp1 do
begin
Server := 'ftp.microsoft.com';
Username := 'anonymous';
Password := 'guest@microsoft.com';
Login; // Enables an anonymous connection to ftp.microsoft.com
end;


Method CreateDirectory

Creates a directory on server

procedure CreateDirectory(DirName: String);

Applied to

TMFtp

Description

Event OnDirectoryCreated will be fired when the directory created.


Method MoveFile

Moves specified file from current directory to another one

procedure MoveFile(Filename, NewDir: String);

Applied to

TMFtp

Description

Not all kinds of FTP server supports this feature.


Method PutFile

Uploads specified file to server

procedure PutFile(LocalFile, RemoteFile: String);

Applied to

TMFtp

Description

If the specified file already exists on server, event OnFtpNeedInfo will be fired to determine whether the file will be overwritten.


Method Quit

Logs off and disconnects from server

procedure Quit;

Applied to

TMFtp

Description

TMFtp

Description

You can call method Disconnect instead of this method and most server don't care about weather the client says goodbye to her.


Method Refresh

Retrieves and refreshes the contents of the current directory

procedure Refresh;

Applied to

TMFtp


Method Refresh

Refreshes the contents of listview

procedure Refresh;

Applied to

TMFtpListView


Method RenameFile

Changes the name of specified file

procedure RenameFile(OldName, NewName: String);

Applied to

TMFtp


Method ResolveLinks

Check whether symbol links are files or directories

procedure ResolveLinks;

Applied to

TMFtp

Description

Event OnResolvedLinks will be fired when the operation done.


Method SelectAll

Select all the items in listview

procedure SelectAll;

Applied to

TMFtpListView


Method Search

Starts searching specified file

procedure Search;

Applied to

TMFtpSearch

Description

Event OnSearchInfo will be fired if any file is found


Method TransferFile

Transfers file between two mftp component

procedure TransferFile(Source, Target: String; TargetFTP: TMFtp);

Applied to

TMFtp

Description

This method is provided and maintained by mEga warrior.


Property Ascending

Specifies how the items in the list are automatically sorted

property Ascending: Boolean;

Applied to

TMFtpListView


Property Accept

Determines whether the control accepts the files that being dropped on it

property Accpet: Boolean;

Applied to

TMFtpListView, TMFtpTreeView


Property Account

Specifies the account for the user specified in property Username

property Account: String;

Applied to

TMFtp


Property AutoScroll

Determines whether TMFtpMessenger scrolls to last message automatically.

property AutoScroll: Boolean;

Applied to

TMFtpMessenger


Property Asynchronous

Determines whether mftp should wait before a operation finished or not

property Asynchronous: Boolean;

Applied to

TMFtp

Description

This property does not effects on multi file operations.


Property BytesTransferred

Indicates bytes transferred of current transfer operation

property BytesTransferred: Longword;

Applied to

TMFtp


Property Busy

Indicates whether component is busy doing something

property Busy: Boolean;

Applied to

TMFtp, TMFtpSearch

Description

If the busy is set true, no method can be executed except the current one.


Property Cache

Determines whether mftp uses cache if available

property Cache: Boolean;

Applied to

TMFtp

Description

Set the property to true can stop you from waiting for the content of directory twice.


Property Cache

Determines whether mftpsearch uses cache if available

property Cache: Boolean;

Applied to

TMFtpSearch


Property CacheExpire

Specifies the days passed since the cache file created before it should be refreshed

property CacheExpire: Integer;

Applied to

TMFtp


Property Client

Specifies a ftp control for the control.

property Client: TMFtp;

Applied to

TMFtpListView, TMFtpMessenger, TMFtpTreeView

Description

Use Client to associate the ftp component which provides all the information needed by the control.


Property Connected

Indicates whether mftp connected to specified server

property Connected: Boolean;

Applied to

TMFtp


Property Directories

Contains the names of directories in current directory

(please see ftpdata.pas for the declaration of TMFtpInfoList)
property Directories: TMFtpFileInfoList;

Applied to

TMFtp


Property Error

Indicates the last error

(please see ftp.pas for the declaration of FTPError)
property Error: FTPError;

Applied to

TMFtp

Description

It's often use within an OnFtpError event in order to generate a detailed error message for user.


Property FileMask

Specifies the parameter of list command being passed to server

property FileMask: String;

Applied to

TMFtp

Description

The parameter can either be a filename or a valid parameter of Unix LS command like "-L". But if this property isn't a empty string, cache will not be updated automatically.


Property Filename

Specifies the name of file you are looking for

property Filename: String;

Applied to

TMFtpSearch

Description

It can be a part of or the whole filename, this is depended on property SearchType.


Property Files

Contains the names of files in current directory

(please see ftpdata.pas for the declaration of TMFtpInfoList)
property Files: TMFtpFileInfoList;

Applied to

TMFtp


Property Files

Contains the names of files or directories found by ftp search engine

(please see ftpdata.pas for the declaration of TMFtpInfoList)
property Files: TMFtpFileInfoList;

Applied to

TMFtpSearch


Property Filter

Specifies filters for listview

property Filter: TStringList;

Applied to

TMFtpListView

Description

When filtering is applied to the listview, only those filenames that meets one of the filters' conditions are visible in the listview.


Property FromDate

Specifies dates that file being searched should newer than, a parameter for ftp search engine

property FromDate: Longword;

Applied to

TMFtpSearch

Description

Three date formats are supported:

  • rfc1123, e.g. Thu, 05 Nov 1998 18:40:00 GMT
  • rfc850, e.g. Thursday, 05-Nov-98 18:40:00 GMT
  • asctime, e.g. Thu Nov  5 18:40:00 1998


Property InitalDirectory

Specifies the initial working directory on the server

property InitalDirectory: String;

Applied to

TMFtp


Property LastReply

Indicates the last response from server

property LastReply: String;

Applied to

TMFtp


Property MaxHit

Specifies a limit to the number of hits, a parameter for ftp search engine

property MaxHit: Longword;

Applied to

TMFtpSearch


Property MaxMatch

Specifies a limit to the number of matches(unique filenames), a parameter for ftp search engine

property MaxMatch: Longword;

Applied to

TMFtpSearch


Property MaxSize

Specifies maximum size of file being searched, a parameter for ftp search engine

property MaxSize: Longword;

Applied to

TMFtpSearch


Property MinSize

Specifies the minimum size of file being searched, a parameter for ftp search engine

property MinSize: Longword;

Applied to

TMFtpSearch


Property NoopInterval

Specifies the amount of time in milliseconds to wait for sending NOOP command to remote server

property NoopInterval: Integer;

Applied to

TMFtp

Description

It is used to prevent remote server from kicking you out of the server, but it doesn't take effects on some servers.


Property Passive

Determines whether mftp use passive mode to transfer files or listings

property Passive: Boolean;

Applied to

TMFtp

Description

Using passive mode can avoid some problems on some ftp server like Troll Tech FTP Server (ftp.troll.no). It's recommended to use, but not all the ftp server support this feature.


Property Password

Specifies the password for the user specified in property Username

property Password: String;

Applied to

TMFtp

Description

For an anonymous connection, you can specified a valid E-Mail address as the login password.


Property Preload

Determines whether preload available directories information from cache

property Preload: Boolean;

Applied to

TMFtpTreeView

Description

Set the property to false will increase the performance of treeview.


Property Port

Specifies the ID number that identifies the FTP connection.

property Port: Integer;

Applied to

TMFtp

Description

By default, the value of port is 21, which is the default port number for FTP.


Property Proxy

Determines whether mftpsearch uses proxy

property Proxy: Boolean;

Applied to

TMFtpSearch

Description

It will use Internet Explorer's proxy setting.


Property ProxyPassword

Specifies the password for proxy authentication

property ProxyPassword: String;

Applied to

TMFtp


Property ProxyPort

Specifies the ID number that identifies the proxy connection.

property ProxyPort: Integer;

Applied to

TMFtp


Property ProxyServer

Specifies the address for proxy

property ProxyServer: String;

Applied to

TMFtp

Description

You can assign either IP address or Domain Name to the property.


Property ProxyType

Specifies the type of proxy

type TMFtpProxyType = (proxyNone, proxyHost, proxyHostUser, proxyOpen, proxySite, proxyUserSite); property ProxyType: TMFtpProxyType;

Applied to

TMFtp

Description

Unfortunately, web based proxy is not support yet although it can be used as a ftp proxy too, I will try to work on it and it may appear in mftp in near future.


Property ProxyUsername

Specifies the username for proxy authentication

property ProxyUsername: String;

Applied to

TMFtp


Property RetriesInterval

Specifies how long mftp should wait between two attempts

property RetriesInterval: Integer;

Applied to

TMFtp


Property Retries

Specifies how many times mftp should attempt to connect to the server

property Retries: Integer;

Applied to

TMFtp


Property SelectedDirectories

Contains the names of selected directories

property SelectedDirectories: TStringList;

Applied to

TMFtpListView


Property SearchType

Specifies search type, a parameter for ftp search engine

(please see ftpsearch.pas for the declaration of TMFTPSearchType)
property SearchType: TMFTPSearchType;

Applied to

TMFtpSearch

Description

The property can be a value of following:

Value | Meaning
mstCIUS | Searches for parts of a filename. Treats uppercase and lowercase letters equally.
mstCNUS | Searches for parts of a filename. Treats uppercase and lowercase letters like different ones.
mstCIGS | Searches for filenames, using globing. Treats uppercase and lowercase letters equally.
mstCNGS | Searches for filenames, using globing. Treats uppercase and lowercase letters differently.
mstRXS | Searches for parts of a filename with a regular expression. Regular expressions are a powerful way of matching text strings.
mstES | Searches for the exact filename. Case is significant.
mstCIUM | Matches for parts of a filename. Treats uppercase and lowercase letters equally.
mstCNUM | Matches for parts of a filename. Treats uppercase and lowercase letters like different ones.
mstCIGM | Matches for filenames, using globbing. Treats uppercase and lowercase letters equally.
mstCNGM | Matches for filenames, using globbing. Treats uppercase and lowercase letters differently.
mstEXM | Matches for parts of a filename with a regular expression


Property Server

Specifies the address for ftp server

property Server: String;

Applied to

TMFtp

Description

You can assign either IP address or Domain Name to the property.


Property Server

Specifies the address for ftp search servers

property Server: TStrings;

Applied to

TMFtpSearch

Description

You can get a complete sever list from my homepage.


Property ServerType

Specifies the type of FTP server running on remote host

(please see ftp.pas for the declaration of TMFtpServerType)
property ServerType: TMFtpServerType;

Applied to

TMFtp

Description

You should not change the value unless the remote host that running a FTP server that cannot auto detect by mftp.


Property SelectedFiles

Contains the names of selected files

property SelectedFiles: TStringList;

Applied to

TMFtpListView


Property SortType

Specifies if and how the items in the list are automatically sorted

type TMFtpSortBase = (stNone, stAttrib, stDateTime, stDescription, stName, stSize, stSymbolLink);

property SortType: TMFtpSortBase;

Applied to

TMFtpListView


Property StartPoint

Indicates start position of download/upload operation

property StartPoint: Integer;

Applied to

TMFtp


Property Style

Determines display style of the Messenger control.

type TMessageStyle = (msgClassic, msgMFtp, msgMFtpTime);

property Style: TMessageStyle;

Applied to

TMFtpMessenger

Description

You will see the differences among these three styles below:

msgClassic

COMMAND:> PWD

257 "/" is current directory

STATUS:> Login successful

ERROR:> Host unreachable

msgMFtp

PWD

257 "/" is current directory

Login successful

Host unreachable

msgMFtpTime

[3/1/99 12:00:00 AM] PWD

257 "/" is current directory

[3/1/99 12:00:00 AM] Login successful

[3/1/99 12:00:00 AM] Host unreachable


Property Success

Indicates whether last action succeed

property Success: Boolean;

Applied to

TMFtp


Property SupportResume

Indicates whether broken downloads/unloads are resumable

property SupportResume: Boolean;

Applied to

TMFtp

Description

Because REST command is not found in standard FTP protocol some servers like Microsoft IIS FTP Server cannot resume broken downloads/uploads. In the case, the property would be set to false.


Property TimeOut

Specifies the amount of time in milliseconds to wait for a response from socket

property TimeOut: Longint;

Applied to

TMFtp

Description

An error will be generated when a operation is timed out.


Property TransferMode

Specifies the transfer mode used when transferring files

type TMFtpTransferType = (AsciiTransfer, BinaryTransfer);

property TransferMode: TMFtpTransferType;

Applied to

TMFtp

Description

The AsciiTransfer sends data as ASCII, as a result of this, it cannot send raw data correctly, so it is recommended that you do not use AsciiTransfer at all.


Property ToDate

Specifies dates that file being searched should older than, a parameter for ftp search engine

property ToDate: Longword;

Applied to

TMFtpSearch

Description

Three date formats are supported:

  • rfc1123, e.g. Thu, 05 Nov 1998 18:40:00 GMT
  • rfc850, e.g. Thursday, 05-Nov-98 18:40:00 GMT
  • asctime, e.g. Thu Nov  5 18:40:00 1998


Property TransferTime

Indicates elapsed time of transfer operation in seconds

property TransferTime: Longword;

Applied to

TMFtp


Property URL

Indicates the URL of current directory or go to specified URL

property URL: String;

Applied to

TMFtp


Property Username

Specifies the username required to login the FTP server

property Username: String;

Applied to

TMFtp


Property Version

Indicates the version information of Monster FTP

property Version: String;

Applied to

TMFtp


Property WebStyle

Determines whether enable something like hot track

property WebStyle: Boolean;

Applied to

TMFtpListView, TMFtpTreeView


To Do Lists

In the future version

  1. Add a combo box control (Chris Godwin)
  2. Complete the help file. Is there any body help me correct the grammar mistakes?
  3. Support MLST
  4. Support password encryption (S/KEY)
  5. Your creative idea?