Unit Ftp4Win

-------------------------------------------------------------------------------------} { This is BETA software. It is not guaranteed to do ANYTHING useful at all. I'm } { looking for useful feedback on problems that exist and design issues. } { Please read the "WORKING NOTES" section below for more information. } { -------------------------------------------------------------------------------------} { -------------------------------------------------------------------------------------} { A component wrapper for the FTP4W library. } { Copyright 1997, Brad Stowers. All Rights Reserved. } { This component can be freely used and distributed in commercial and private } { environments, provied this notice is not modified in any way. } { -------------------------------------------------------------------------------------} { Feel free to contact me if you have any questions, comments or suggestions at } { bstowers@pobox.com or 72733,3374 on CompuServe. } { You can always find the latest version of this component at: } { http://www.pobox.com/~bstowers/delphi/ } { -------------------------------------------------------------------------------------} { FTP4W is Copyright 1994-1997, Philippe Jounin and SNCF (French Railways). } { The latest version of FTP4W can be found at: } { http://www.magic.fr/~jounin-ph/ } { -------------------------------------------------------------------------------------} { Date last modified: Mar. 18, 1997 } { -------------------------------------------------------------------------------------} { -------------------------------------------------------------------------------------} { TFTP4W v0.70 BETA } { -------------------------------------------------------------------------------------} { } { Description: } { An FTP client component. } { } { -------------------------------------------------------------------------------------} { } { WORKING NOTES: } { * The firewall stuff is not implemented in FTP4W. Philippe says that he has code } { for it, but he has no way of testing it. Contact him directly at } { jounin-ph@magic.fr if you can help with this. See the FTP4W docs for more info. } { * Didn't implemented FtpMGet because docs say to only use in synchronous mode, and } { I don't support sync mode in the component. It is fairly easy to implement } { multiple gets using the OnRetrieveFinished event to start the next get. } { } { -------------------------------------------------------------------------------------} { } { Beta Revision History: } { 0.50: + Initial beta release. } { 0.60: + Updated to use FTP4W v3.0. You should now be able to have multiple FTP } { sessions per application. Make sure you get the new DLL from Philippe's } { we page (URL above). } { + Some servers didn't like the way I was doing restarts. I've changed the } { component so that it uses FTP4W's restart transfer commands. These } { commands require a file handle created by the old Win16 file functions. } { So, when this doesn't work on Windows 2000, it's because the Win16 file } { functions have finally stopped working. :) } { + IsConnected property incorrectly reported true if a connection attempt } { failed. } { + LastErrorStr property wasn't returning anything. Don't know why the } { compiler didn't generate a warning on that... } { 0.70 + FTP4W.DLL is only loaded at run-time now, i.e. Delphi doesn't load it when } { TFTP4W is compiled into the component library. } { + Added threading to remove the socket blocking call problems, i.e. your app } { won't respond when a FTP4W routine is being accessed. } { If you want to use the blocking calls (why would you?), you can set the new } { UseThreading property to FALSE. } { } {--------------------------------------------------------------------------------------

Classes

TFTP4W -

Functions

RawToStrings - Utility function to convert CR, LF or CR/LF delimited text into TStrings

Utility function to convert CR/LF delimited text to TStrings
Register -

Types

TFTPConnected
TFTPDirectoryRefreshed
TFTPDirectoryStatus
TFTPDisconnected
TFTPFirewall
TFTPGotLine
TFTPRetrieveFinished
TFTPRetrieveStatus
TFTPSendFinished
TFTPSendStatus
TFTPTransferType
TSuccessEvent
TTransferFinishedEvent
TTransferStatusEvent

Constants

DEF_LOG_FILENAME

Variables


Functions


procedure RawToStrings(Raw: string; Strs: TStrings);

Utility function to convert CR, LF or CR/LF delimited text into TStrings

Utility function to convert CR/LF delimited text to TStrings


procedure Register;


Types


TFTPConnected = TSuccessEvent

TFTPDirectoryRefreshed = TSuccessEvent

TFTPDirectoryStatus = procedure(Sender: TObject; AFilename: string) of object

TFTPDisconnected = TNotifyEvent

TFTPFirewall = (fwNone, fwSite, fwProxy, fwUserWithLogon, fwUserNoLogon);

TFTPGotLine = procedure(Sender: TObject; ALine: string) of object

TFTPRetrieveFinished = TTransferFinishedEvent

TFTPRetrieveStatus = TTransferStatusEvent

TFTPSendFinished = TTransferFinishedEvent

TFTPSendStatus = TTransferStatusEvent

TFTPTransferType = (ttAscii, ttBinary, ttLocal8, ttUnknown);

TSuccessEvent = procedure(Sender: TObject; Success: boolean) of object

TTransferFinishedEvent = procedure(Sender: TObject; Success: boolean; BytesTransferred: longint) of object

TTransferStatusEvent = procedure(Sender: TObject; BytesTransferred, BytesTotal: longint) of object

Constants

DEF_LOG_FILENAME = 'FTP.LOG'


Variables