Delphi Developers
File Transfer Components

Download MagXfer Source 
Code for Delphi 7/2006/2007/
2009/2010/XE-XE8/10 Seattle/10.1 Berlin/10.2 Tokyo and ICS v8
v4.6/v4.6W - 7 Mar 2017
(6,436,800 bytes)

Download ICS v8
for Delphi 7/2006/2007/
2009//2010/XE-XE8/
D10/D10.1/D10.2
v8 - 27 Mar 2017
(8,982,792 bytes)

Delphi Home Page

Other Magenta
Sites

CodeLook
lookup telephone
numbers and cost

ComCap v4
data capture utility

DUN Manager
broadband and dial-up
networking enhancement

MailMaint
POP3 email

Delphi Developers

UK Telecom
Tariff Comparisons

Links to Other
General Sites

Links to Other
Telecom Sites


Magenta Home Page

Email Magenta Systems

22nd March 2017 - New version v4.6 for ICS v8, supports Delphi 7 to XE8, 10 Seattle, 10.1 Berlin and 10.2 Tokyo for Win32 and Win64

Magenta Systems File Transfer Components comprise three Delphi components, TMagFtp, TMagHttp and TMagFileCopy, the first two of which are high level descendants of the ICS TFtpClient and THttpCli components, all allowing transfer of multiple files and subdirectories with a single function call.  An entire disk volume or just one file may be copied or sent using FTP.

The three components handle file listing from FTP, HTTP and disk volumes, and multiple file copying. They also include optional zipping or unzipping (requires TVCLZip component). There are numerous options available, including copying only newer files, deleting old target files, deletion after transfer, resumed failed FTP downloads and uploads, and a progress events with various levels of information for logging or display, depending upon application requirements that allows transfers to be cancelled. FTP and file copying supports files larger than 2 gigs (64-bit).

The components support Delphi 7 to 2007, 2009, 2010, XE to XE8, 10 Seattle,10.1 Berlin and 10.2 Tokyo, and ICS v8, Win32 and Win64. Active development is with the 4.x version and ICS V8, older versions support older ICS versions.

  •  v4.6 supports ANSI named files with Delphi 7 and 2007, and Unicode named files with Delphi 2009 and later, with ICS v8, both Win32 and Win64. This release supports IPv6.
  •  v4.6W supports Unicode named files on Delphi 2007 with ICS v8 only, using custom wide versions of the ICS components with widestrings. This version also includes a widestring version of the ICS FTP server supporting full Unicode with Delphi 2007. The TNT Delphi Unicode Controls are used to display a Unicode log window. This release supports IPv6.

All the v4.6w units and types have a W suffix (for widestring).

A simple demonstration program that illustrates all major functionality. End user help is available describing most of the functionality in Magenta Systems DUN Manager application look under Scheduled Task Properties, FTP General, FTP Common, FTP Upload, FTP Download. HTTP Download and Sync Files. DUN Manager also provides a compiled test application for the components, using all functions (but DUN Manager source code is not available).

There are three demo executables in the distribution using v4.6:

  • xferdemo3a.exe is built with Delphi 2007 with ASCII support
  • xferdemo3u.exe is built with Delphi 10.2 Tokyo Win32 with Unicode support
  • xferdemo3w.exe is built with Delphi 2007 with Unicode support

Magenta Systems File Transfer Components are copyrighted software, but may be used without further cost.

Internet Component Suite (ICS)

The Magenta Systems File Transfer Components components need François Piette Internet Component Suite (ICS) version 8 from the latest snapshot at http://wiki.overbyte.eu/wiki/index.php/FAQ  (or the link at the left). Requires ICS V8.43 dated March 2017 or later.

The latest ICS SVN release may be downloaded as a zip: ICS V8, or directly from the SVN repository from the ICS Components page.

Requires Kevin Boylan's TVCLZip component for zipping from http://www.vclzip.net/, if you don't purchase this component you will need to suppress DEFINE Zipping from MAGZIP.INC so the zip code is not linked.

Unicode Compatibility with various web servers

Originally, FTP servers only support ASCII file names, but later sent file names as 8-bit ANSI characters. If the underlaying operating system has a Unicode file name with characters outside ANSI, they are substituted with a question mark, which is an illegal file name character in Windows. FTP servers with UTF8 support encode all file names in 8-bit UTF8, where essentially the lower 128 characters are unchanged, and other characters are represented by two or more alternate characters.

Even though an FTP server supports UTF8, it may not include Unicode characters outside the ANSI codeset. The FTP 'OPTS UTF8' or 'OPTS UTF8 ON' command must be sent before most servers support UTF8 file listings or uploads.

ICS V6 - does not support UTF8.

ICS V7/V8 - support UTF8, fully Unicode capable when build with Delphi 2009 or later, defaults to UTF8 OFF and returns ANSI file listings, OPTS UTF8 or OPTS UTF8 ON enables UTF8 file listings and uploads.

ICS V7/V8 Wide - support UTF8, fully Unicode capable when build with Delphi 2007 or later defaults to UTF8 OFF and returns ANSI file listings, OPTS UTF8 or OPTS UTF8 ON enables UTF8 file listings and uploads.

Microsoft IIS/5 and IIS/6 - no UTF8 support.

Microsoft FTP7 IIS/7 for Windows 2008 - fully Unicode capable, defaults to UTF8 OFF and returns ANSI file listings, OPTS UTF8 or OPTS UTF8 ON enables UTF8 file listings and uploads.

FileZilla Server - fully Unicode capable, defaults to UTF8 ON returning UFT8 file listings and uploads, but can be disabled with OPTS UTF8 OFF command when listings revert to ANSI.

WS_FTP Server 6.1.1 and 7 - fully Unicode capable, defaults to UTF8 OFF and returns ANSI file listings, OPTS UTF8 or OPTS UTF8 ON enables UTF8 file listings and uploads, UTF8 can not be set off so don't send command if ANSI needed. MLST fails with 501 if file name includes a space.

RhinoSoft Serv-U FTP Server v7.2.0.1 - no Unicode support, defaults to UTF8 OFF but returns UTF8 file listings (with ? for non-supported unicode characters), OPTS UTF8 ON enables UTF8 uploads. OPTS UTF8 OFF command reverts listings to ANSI. MLST fails with 550 for file names with any UTF8 escaped characters MDTM YYYYMMDDHHMMSS fail if timezone used (worked in earlier releases).  v7.3.0.0  fixes the MLST and MDTM errors, and adds the MFMT command, v8 will support Unicode.

Gene6 FTP Server v3.10.0 - fully Unicode capable, defaults to UTF8 OFF and returns ANSI file listings, OPTS UTF8 or OPTS UTF8 ON enables UTF8 file listings and uploads, UTF8 can not be set off so don't send command if ANSI needed. MLSD fails with a Unicode sub-directory argument (but CWD works OK with Unicode).

Unicode VCL

To display Unicode characters in Delphi 2007, TNT Delphi Unicode Controls may be used to replace the standard VCL controls such as TMemo, TButton, etc. The original free version is available from:

http://mh-nexus.de/en/tntunicodecontrols.php

http://www.axolot.com/TNT/

while the latest commercial TNT version may be bought as the TMS Unicode Component Pack from:

http://www.tmssoftware.com/site/tmsuni.asp

Note the TMagXfer demo deliberately does not use these components, to avoid them being a pre-requisite.

Usage Overview

TFileRec

The three file transfer components all rely on a common file listing record type:

TFileRec = record
FrFileName: string ; // filename and extension
FrSubDirs: string ; // \ for base directory, else located sub dirs
FrDirLevel: integer ; // 0 for base directory, or level of sub dirs
FrDirBaseLen: integer ; // length of basedir within FullName
FrFullName: string ; // basedir, subdirs, filename - complete path
FrFileBytes: int64 ; // size of file in bytes
FrFileDT: TDateTime ; // file time stamp - local time
FrFileUDT: TDateTime ; // file time stamp - UTC time
FrFileAttr: integer ; // bitmapped Windows file attributes
FrExtra: string ; // <DIR> or UNIX file attributes
FrLinks: string ; // not blank means this is not a real file
FrFileCopy: TFileCopyState ; // file copy state, selected, done, etc,
end ;

This record is used in TFileRecs dynamic arrays, and is filled by Windows FindFile APIs for local files (in BuildDirList2) , from the FTP DIR or MLSD commands (in FtpDir), or by parsing HTML for links (in Download).  Local and FTP file indexing optionally supports listing sub-directories. Generally, two file record lists are built, for local and remote files, and then compared (using SelectCopyFileList) to select the files that need to be copied and optionally deleted (locally or remotely) to cause synchronisation of directories.

The components also offer methods for handling single files, rather than whole directories.


TFindList

This is a descendent of TList added a Find function using binary search identical to sorting, that is much more efficient than the normal IndexOf method when the file list contains potentially up to a million items.

function Find (const Item2: Pointer; Compare: TListSortCompare;
var index: longint): Boolean;

This is used with the function CompareFNext to compare file name records with case insensitivity. A list of file name records in the dynamic array is built into a TFindList and sorted, allowing the files to accessed in sorted order, and also easing comparison between source and target lists. Generally, this file list handling is all hidden, when doing straight copying.


TBulkCopyEvent


The three component also share a common progress event, that returns various levels of progress information for display to the user and for logging, depending upon the application. The progress events also allows copying to be cancelled, including part way through a file.

TBulkCopyEvent = Procedure (LogLevel: TLogLevel ; Info: string ;
var Cancel: boolean) of object ;

LogLevelInfo - general copying information, start, finish, etc
LogLevelFile - file level information, start, finish, etc
LogLevelProg - progress per file, chunks copied - avoid if possible
LogLevelDiag - diagnostic information - generally ignore
LogLevelDelimFile - seven | delimited fields after each file for logging
LogLevelDelimTot - seven | delimited fields after each job for logging

The delimited logging lines are seven fields:

SrcFile|TarFile|Size|Succ|Fail|Comm|Duration

Where succ and fail are digits, 0 or 1 for single files, larger for totals, duration is milliseconds, comment might be OK or reason for failure.

For example, for LogLevelDelimFile after copying a single file:

d:\windows\system32\drivers\gmreadme.txt|d:\tempfiles\drivers\gmreadme.txt|646|1|0|OK|15

For example, for LogLevelDelimTot, totals after copying a directory:

d:\windows\system32|d:\tempfiles|419554|49|0|Totals|

TProgressEvent

Release 4.1 introduced a more detailed file copying progress for the current file and session, passed by TProgressEvent between each file and while a file is being processed.

TProgressEvent = Procedure (Sender: TObject ; CopyProgress: TCopyProgress ;var Cancel: boolean) of object ;

TCopyProgress = record
LogLevel: TLogLevel ; // log level
Info: String ; // simple display information
ProgMessBase: String ; // partial progess info
CurSrcName: String ; // current copy source file
CurTarName: String ; // current copy target file
CurDelName: String ; // current delete file
CurOKDone: int64 ; // bytes copied of current file
CurFileBytes: int64 ; // size of file being copied
CurStartTick: longword ; // when current file started copying or deleting in ticks (from when PC booted)
CurEstimateTicks: longword ; // current file estimated copying time based on first 5 seconds in ticks (1,000th/sec)
CurDonePercent: integer ; // current file percentage copied
CurDoneTicks: longword ; // current file copying duration in ticks
TotProcFiles: integer ; // total files to process in session
TotDoneNr: integer ; // how many files processed so far
TotProcBytes: int64 ; // total size of files to copy in session
TotDelFiles: integer ; // total number of files to delete
TotDelBytes: int64 ; // total size of files to delete in session
SessStartTick: longword ; // when session started in ticks (from when PC booted)
SessEstimateTicks: longword ; // session estimated time updated after each file in ticks (1,000th/sec)
SessDonePercent: integer ; // total files percentage copied
SessDoneTicks: longword ; // total files copying duration in ticks
SessAvSpeed: integer ; // total files average speed so far
ProcOKFiles: integer ; // total files copied OK in session
DelOKFiles: integer ; // total files deleted OK in session
ProcFailFiles: integer ; // total files failed copy in session
SkippedFiles: integer ; // total files skipped copy in session
ProcBytesDone: int64 ; // total size of files copied OK or failed in session
ProcBytesLast: int64 ; // total bytes copied up to start of current file
ProcOKBytes: int64 ; // total size of files copied OK in session
DelOKBytes: int64 ; // total size of files deleted in session
LastProgTick: longword ; // used to suppress progress messages for ProgressSecs
end ;

LogLevel and Info are the same as passed by the original TBulkCopyEvent, the other elements detail progress for the current file, and overall progress for the session, and may be used to display more detailed progress information in a variety of formats. onProgressEvent in the demomain3.pas illustrates a simple two line textual display, but progress bars could also be used.

Note that CurFileBytes being none zero means a file is currently being processed and the other current file elements can be displayed, while TotProcBytes being non zero means session information is available. Current file and session durations may be found by using the function ElapsedTicks passing CurStart|Tick or SessStartTick. The component attempts to estimate the current file processing time and total session time based on size processed so far with an allowance for opening each file, but will be less accurate when processing large numbers of small files, and how much extra processing takes place, such as zipping, checking MD5sums, etc.

TFileCopyType

Specifies the type of copying the component should perform, also used for file deletion.

FCTypeSingle - just a single file will be copied
FCTypeMaskDir - multiple files will be copied that match the mask file Name (ie *.* for all *.zip for just zip files)
FCTypeArchDir - any files with the Archive file attribute set and matching the mask will be copied. Note the attribute is not changed
FCTypeAllDir - all files found will be copied.
FCTypeDates - all files found will be copied within a date/time range


TFileCopyRepl


Specifies whether target files that exist should be replaced.

FCReplNever - copy will be skipped
FCReplAlways - always replace
FCReplDiff - replace if time stamp or size different
FCReplNewer - replace if time stamp newer or size different


TFileCopyState


This is primarily an internal copy state kept in TFileRec for each file, which is updated as selection and copying proceeds.

FCStateNone - nothing done
FCStateIgnore - copy will be skipped
FCStateDir - file is directory entry
FCStateSelect - waiting to copy file
FCStateCopying - file being copied
FCStateOK - copied OK
FCStateFailed - copy failed


TTaskResult


Many of the methods return a typed task result:

TaskResNone - task did not start
TaskResOKNew - task finished OK and copied files
TaskResOKNone - task finished OK but found nothing to copy
TaskResFail - task failed, reason will be in ReqResponse property
TaskResAbort - task was aborted, usually by user or lost connection


The full interface sections of the various components are listed in interfaces.txt.


TMagFileCopy

TMagFileCopy is a high level HTTP Delphi component that allows indexing and copying of multiple file directories, using a single function call. The component handles listing source and destination files, and comparing them to avoid unnecessary transfers, selection using a file mask, deletion of old files, delete after copy, safe copy (to avoid partial files), and zip before copying or unzip after copy. The component is equally useful for copying single files or entire volumes with hundreds of thousands of files, and provides 'sync files' functionality making it ideal for backups, only copying changed files and deleting old target files.

Note there are two distinct copying modes in TMagFileCopy, copying a single directory (and subdirectories) and copying a list of multiple specific directories (and subdirectories).

Properties to set before copying multiple files:

CopyEvent: TBulkCopyEvent - with a logging and progress function

MultiDir: boolean - true copy multiple specific directories, false single

MultiDirList: string - multi directories are passed as srcdir+tab+tardir+recsep (repeat) for as many pairs as needed. The srcdir may optionally include a masked file name (including *)

SrcDirList: TStringLists - alternate to MultiDirList, source dirs only
TarDirListTStringLists - alternate to MultiDirList, target dirs only


SrcDir: string - not multidirs, the source directory
TarDir: string - not multidirs, the target directory
SrcFName: string - optional mask name (including *) for partial copy
SubDirs: boolean - true copy all sub directories

CopyType: TFileCopyType - see above
LocalHost: string - set to WSocket.LocalHostName if using masked name
Mask: boolean - true, allow date/time mask characters in SrcFName, also $H will be replaced by the LocalHost (see above)
Prev: boolean - true, use yesterday's date for Mask

DelDone: boolean - true delete source file after copy
DelOldTar: boolean -true, delete target files not in source directory
Repl: TFileCopyRepl - see above
ReplRO: boolean - true, replace read only files
Safe: boolean - true, copy file with TMP extension, rename when done
IgnoreFileExt: string - a delimited list of file extensions to ignore

UseUTC: Boolean - whether to compare file timestamps in UTC or local time
CopyLoDT: TDateTime - for CopyType FCTypeDates, lower date/time
CopyHiDT: TDateTime - for CopyType FCTypeDates, higher date/time

Main Methods

function SelCopyFiles (const CheckFiles: boolean): TTaskResult ;

This is the main method that selects and copies files.

If CheckFiles is true it skips the actual copying just returning a list of the files selected for copying, with file records in SrcFiles and the sorted pointers in SrcFileList, if CopyState is FCStateSelect the file has been selected for copying.

If CheckFiles is false, the selected files will be copied, with the result showing success or otherwise. Several properties are completed with various totals processed: TotProcFiles, ProcOKFiles, DelOKFiles, ProcFailFiles, SkippedFiles, TotProcBytes, ProcOKBytes and DelOKBytes. The file records in SrcFiles and the sorted pointers in SrcFileList are
updated with the success or failure of each file copied, although logging will normally have been done on a file by file basis through the CopyEvent.

Use of the SelCopyFiles function is illustrated in the demo application.


function DeleteFiles (const CheckFiles: boolean): TTaskResult ;

This method is for deleting multiple files, it uses the same source file properties as SelCopyFiles, including CopyType, except no MultiDir.

Use of the DeleteFiles function is illustrated in the demo application.


procedure Cancel ;

This method will cancel copying.


function GetTaskResName (TaskResult: TTaskResult): string ;

This function returns an ASCII version of the task result.


Support Functions

A number of the functions used internally by SelCopyFiles are available for separate use in applications that need to index and process files.

function MagDeleteFile (const Fname: string;
const ReadOnly: boolean): Integer ;

This function deletes a single file, optionally removing the read only attribute. Returns 0 for delete OK, -1 file not found, 1 could not remove read only, larger number failed and is GetLastError code.


function MagRenameFile (const OldName, NewName: string;
const Replace, ReadOnly: boolean): Integer ;

This function renames a single file, optionally replacing it, optionally removing read only attribute. Returns 0 for replace OK, 1 could not remove read only, 2 new file exists (and Replace false), larger number failed and is GetLastError code.


function DeleteEmptyDirs (RootDir: string; DirList: TStringList): integer ;

This function deletes empty directories, typically after all the files in them have been deleted. It also deletes higher level directories, down to the specified root directory.


function CopyOneFile (const Fnamesrc, Fnametar: string ; Replopt:
TFileCopyRepl; const Safe: boolean; var Fsize: Int64) : TTaskResult ;

This function copies a single file, using source and target file names, and standard Replopt options. Fsize will be filled with the size copied, if successful. CopyEvent is called with progress messages.


function BuildDirList2 (LocDir, LocPartName: string; const SubDirs:
boolean; Level, InitDLen: integer ; const LoDT, HiDT: TDateTime ;
var TotFiles: integer; var LocFiles: TFileRecs): boolean ;

This is the main local file indexing function, that calls itself recursively if SubDirs is specified to build-up lists of files in the root and sub-directories. LocDir is the local directory to index, it may be a root. LocPartName is an optional file name mask for sub-selection. Level and InitDLen should be 0 (they are used for recursive calls). LoDT and HiDT are an optional date selection range (if non-zero). Files are listed in non-sorted order into a dynamic array LocFiles, with the initial number of listed files in the array specified by TotFiles (this need not be zero). The CopyEvent is called with progress messages. It returns false for error or if cancelled from CopyEvent. This function will index hundreds of thousands of files on a large volume, but will take a few minutes to do so.


function BuildDirList (LocDir, LocPartName: string; const SubDirs:
boolean; Level, InitDLen: integer ; var TotFiles: integer;
var LocFiles: TFileRecs): boolean ;

This function calls BuildDirList2, but ignores file date ranges.


function GetDirList (LocDir, LocPartName: string; const SelOpt:
TFileCopyType; const SubDirs: boolean; LoDT, HiDT: TDateTime ;
var LocFiles: TFileRecs; var LocFileList: TFindList): integer ;

This function calls BuildDirList2, but has differing parameters, in particular SelOpt and a LocFileList which is filled with a sorted pointer list to LocFiles. It returns the total number of files found or -1 if cancelled or an error.


function SelectCopyFileList (const SrcFileList, TarFileList: TFindList;
const fname: string; const selopt: TFileCopyType;
const replopt: TFileCopyRepl; const DiffStamp: integer;
const IgnoreOldTime: boolean; IgnoreExt: string ;
var skipped: integer; const UTCFlag: boolean): integer ;

This is the main function that is used to compare source and target file lists against each other and the specified Copy Type and Replace options and to select files that should be copied. It may also be used to locate which files are in the target directory but not the source, to allow deletion is synchronising directories. When comparing hundreds of thousands of files, this function will take a few minutes. DiffStamp is the number of minutes difference in time stamp before a file is
considered different, use 61 or 62 minutes to avoid summer times issues.


function MagCheckReplace (const replopt: TFileCopyRepl;
const IgnoreOldTime: boolean; const AllowDiffDT: TDateTime;
const SrcSize, TarSize: Int64; SrcDT, TarDT: TDateTime): boolean ;

This function is used to determine if a single file should be replaced, by comparing file sizes and time stamps, and the specified Replopt option.


function FmtFileDir (const FileRecs: TFileRecs;
const UTCFlag: boolean): string ;

Format an unsorted file directory from FileRecs array, into a multi-line ASCII string which may be very large.


function FmtFileDirList (const LocFileList: TFindList;
const UTCFlag: boolean): string ;

Format an sorted file directory from File List pointer to an array, into a multi-line ASCII string which may be very large.


function DispLocFiles (const SrcDir, SrcFile: string ; const CopyType:
TFileCopyType ; const SubDirs: boolean; const UTCFlag: boolean): string ;

This function builds a displayable file directory a multi-line ASCII string, it calls BuildDirList2 and FmtFileDirList.

Use of the DispLocFiles function is illustrated in the demo application.


function CheckDirAny (LocDir: string): boolean ;

Check if a directory contains at least one file or sub-directory, used before deleting the directory.


Network File Share Methods

File copying will often work across a LAN using UNC share names, provided the remote computer accepts the same logon as the local computer. If not, it's necessary to first connect to the remote computer with a logon, which can either map a drive letter to the remote share or just create a connection so UNC file names may be used for copying. Note it's more
efficient to use mapped drives. Properties that should be set are:

LocalName: string - blank if using UNC names, otherwise drive, ie N:
RemoteName: string - UNC name of remote share, ie \\sysname\share
UserName: string - a logon user name for remote share
Password: string - a logon password for remote share

Methods

function Connect: boolean ;

Connect with LocalName, RemoteName, UserName and Password to the remote computer, true if successful, error in ReqResponse, CopyEvent is called.

function Disconnect (AForce: boolean): boolean ;

Disconnect the remote share specified in LocalName or RemoteName.


function GetConnection (ALocalName: string): string ;

Checks if a local drive, ie N:, is connected to a remote share, returning the remote name if found, or blank if not. Result also in ReqResponse.



TMagFTP

TMagFtp is a high level FTP Delphi component that allows uploading or downloading of multiple files from or to an FTP server, from a single function call. The component handles listing local and remote files, including subdirectories, and comparing them to avoid unnecessary transfers, selection using a file mask, deletion of old files, resuming failed FTP downloads, unzipping of downloaded files, or zipping before upload, deletion after uploading or downloading, archive copy after upload. A progress event provides various levels of information for logging or display, depending upon application requirements, and allows transfers to be cancelled.

TMagFtp descends from ICS TFtpClient, and publishes all it's logon and proxy properties and events.

Note the component transfer files using temporary file names, only renaming them to the correct name once the file is confirmed as being the correct size. So the file test.zip will be uploaded as test_zip.tmp. This avoids partial real files being left if a connection drops, and is also used for file resuming, which uses the name test_zip.ftp on the local computer to store details for possible resumed upload or download in case of interruption. The component may be set to immediately repeat
a failed transfer, a specified number of times.

The component attempts to make of the most efficient FTP commands supported by the server, as reported by the FEAT command. Specifically, historically FTP had very poor file indexing with different servers returning widely differing responses to the LIST file directory command.  The component will use the MLSD, MSLST and MDTM commands if possible for
better listing (using UTC time in particular), and will also use MFMT or MDTM YYYYMMDDHHMMSS to set the time stamp of uploaded files, if possible.  It uses the MD5 command to perform an MD5SUM check on transferred files to confirm file integrity.

Properties to set before transferring any files, these relate to the FTP server and optional proxies, retries, etc. Also see the ICS documentation for details of specific FTP properties.

HostName1: string - main FTP server host name or IP address
HostName2: string - alternate FTP server host name or IP address, if main server can not be contacted
UserName: string - FTP server logon name
PassWord: string - FTP server logon password
Port: string - FTP server port, usually 21
MaxAttempts: integer - number of attempts to connect to the FTP server, if HostName2 is specified this will alternate with HostName1
AttemptDelay: integer - delay in seconds between connection attempts
FailRepeat: integer - how many times to retry a failed file transfer
ConnectionType: TFTPConnectionType - ftpDirect, ftpProxy, ftpSocks4, ftpSocks4A, ftpSocks5
ProxyPort: string - if ConnectionType = ftpProxy
ProxyServer: string - if ConnectionType = ftpProxy
SocksPort: string - if ConnectionType = ftpSocksX
SocksServer: string - if ConnectionType = ftpSocksX
SocksUsercode: string - if ConnectionType = ftpSocksX
SocksPassword: string - if ConnectionType = ftpSocksX

PassiveX: boolean - must only be changed after connection type, true if FTP passive mode is to used for the data connection
HostType: THostType - set to FTPTYPE_NONE for automatic detection
XferMode: TXferMode - set to XferModeBinary
CaseFile: TCaseFile - FileLowerCase for Windows, sometimes FileMixedCase for Unix/Linux which has case sensitive file names
DiffStampMins: integer - number of minutes difference in time stamp before a file is considered different, use 61 or 62 minutes to avoid summer times issues
Timeout: integer - seconds to wait for response to command, typically 60
DispFiles: boolean - true to log file stamp information
DispRDir: boolean - true to log remote file directory
DispLDir: boolean - true to log local file directory
DispRemList: boolean - true to log FTP LIST responses for remote dir
UpArchive: boolean - true to move file to archive directory after successful upload, to avoid it being uploaded again
UpArchDir: string - if UpArchive true, directory to move file

ResFailed: boolean - if true, if possible resume failed uploads or downloads. This requires a small file to be saved on the local
PC, see above
BulkMode: TBulkMode - VERY important, either BulkModeDownload or BulkModeUpload, this determines how SrcDir/TarDir are used
SrcDir: string - the source directory, a local directory should include a drive or share, a remote directory should not since it will be the FTP server root for the user (also use forward slashes)
TarDir: string - the target directory
SrcFName: string - optional mask name (including *) for partial copy
SubDirs: boolean - true copy all sub directories

CopyType: TFileCopyType - see above, but not by Date Range
LocalHost: string - set to WSocket.LocalHostName if using masked name
Mask: boolean - true, allow date/time mask characters in SrcFName, also $H will be replaced by the LocalHost (see above)
Prev: boolean - true, use yesterday's date for Mask

DelDone: boolean - true delete source file after copy
DelOldTar: boolean -true, delete target files not in source directory
Repl: TFileCopyRepl - see above
ReplRO: boolean - true, replace read only files
IgnoreFileExt: string - a delimited list of file extensions to ignore


Main single functions:

These functions handle the entire FTP process, including connecting and logging onto the FTP server, checking remote and local files, then transferring any files, and finally logging off the FTP server.


function DispFtpDir (var dirlisting: string): TTaskResult ;

This function return a formatted file directory from the FTP server of the target directory and optionally sub-directories, BulkMode should be set to BulkModeDownload. The result will show success or otherwise.

Use of the DispFtpDir function is illustrated in the demo application.


function FtpDownload (const CheckFiles: boolean): TTaskResult ;

This is the main method that selects and download files.

If CheckFiles is true it skips the actual download just returning a list of the files selected for downloading, with file records in SrcFiles and the sorted pointers in SrcFileList, if CopyState is FCStateSelect the file has been selected for downloading.

If CheckFiles is false, the selected files will be downloaded, with the result showing success or otherwise. Several properties are completed with various totals processed: TotProcFiles, ProcOKFiles, DelOKFiles, ProcFailFiles, SkippedFiles, TotProcBytes, ProcOKBytes and DelOKBytes. The file records in SrcFiles and the sorted pointers in SrcFileList are
updated with the success or failure of each file downloaded, although logging will normally have been done on a file by file basis through the CopyEvent.

Use of the FtpDownload function is illustrated in the demo application.


function FtpUpload (const CheckFiles: boolean): TTaskResult ;

This is the main method that selects and uploads files.

If CheckFiles is true it skips the actual uploading just returning a list of the files selected for uploading, with file records in SrcFiles and the sorted pointers in SrcFileList, if CopyState is FCStateSelect the file has been selected for uploading.

If CheckFiles is false, the selected files will be uploaded, with the result showing success or otherwise. Several properties are completed with various totals processed: TotProcFiles, ProcOKFiles, DelOKFiles, ProcFailFiles, SkippedFiles, TotProcBytes, ProcOKBytes and DelOKBytes. The file records in SrcFiles and the sorted pointers in SrcFileList are updated with the success or failure of each file uploaded, although logging will normally have been done on a file by file basis through the CopyEvent.

Use of the FtpUpload function is illustrated in the demo application.


procedure Cancel ;

This method will cancel downloads or uploads.


function GetTaskResName (TaskResult: TTaskResult): string ;

This function returns an ASCII version of the task result.


function LookupFTPReq (const RqType: TFtpRequest): String;

This functions returns an ASCII version of TFtpRequest, for diagnostic purposes.


function LookupFtpState (const FtpState: TFtpState): String;

This functions returns an ASCII version of TTFtpState, for diagnostic purposes.


Main multiple functions

These functions are used where more control is needed over the FTP process, for instance where several single files are to be transferred rather than an entire directory, or where a list of directories need to be transferred. FtpLogon must be called first, and FtpLogoff last.

function FtpLogon: TTaskResult ;

This function connects and logs onto to FTP server, the result will show TaskResOKNew for successful logon, with any error in ReqResponse. The Connected property will also be true, and FtpLogoff must then be called at some point.

Use of the FtpLogon function is illustrated in the demo application.


function FtpDir (var FtpFiles: TFileRecs;
var FtpFileList: TFindList): TTaskResult ;

This function builds file directory lists from the FTP server of the target directory and optionally sub-directories, BulkMode should be set to BulkModeDownload. The result will show success or otherwise. It will fail unless the Connected property is true.


function FtpCheckFile (const RemDir, RemFile: string ;
var FSize: Int64; var FileUDT: TDateTime): boolean;

This function checks the time stamp and size of a single file on the FTP server. It is used by the MagFtp component before every download and before and after every upload, to check the remote file details. It will fail unless the Connected property is true.


function FtpDownFiles (const CheckFiles: boolean): TTaskResult ;

This function is identical to FtpDownload, except it assumes an already connected FTP server. It will fail unless the Connected property is true.


function FtpDownOneFile (const FdirSrc, Fnamesrc, Fnametar: string ;
Replopt: TFileCopyRepl) : TTaskResult ;

This function will download a single file from an already connected FTP server. It will fail unless the Connected property is true.

Use of the FtpDownOneFile function is illustrated in the demo application.


function FtpUpOneFile (const LocFileFull, RemTarDir, RemTarFile: string;
Replopt: TFileCopyRepl) : TTaskResult ;

This function will upload a single file to an already connected FTP server. It will fail unless the Connected property is true.


procedure FtpLogoff ;

This function will disconnect from FTP server, if there is already a connection to the server. It will wait up to five seconds to confirm the connection has been closed

Use of the FtpLogoff function is illustrated in the demo application.


TMagHttp

TMagHttp is a high level HTTP Delphi component that allows downloading of multiple files from an HTTP server using full URLs, or listed by parsing links from a web page, using a single function call. The component handles listing local and remote files, and comparing them to avoid unnecessary transfers, selection using a file mask, unzipping of downloaded files. A progress event provides various levels of information for logging or display, depending upon application requirements, and allows downloads to be cancelled. If authentication is needed for the download, it may be specified in the URL in the format
http://logon:password@host/file.zip.

TMagHttp descends from ICS THttpCli, and publishes all it's properties and events.

Properties to set before downloading any files, these relate to the HTTP server and optional proxies, retries, etc. Also see the ICS documentation for details of specific HTTP properties such as authorisation or SOCKS.

URLList: string - one or more source URLs separated by CRLF
SrcMask: string - optional mask name (including *) for partial downloads
DownDir: string - the target directory for downloaded files
KeepPath: boolean - if true, use HTTP path for subdirs in DownDir
KeepHost: boolean - if true, use HTTP host for subdir in DownDir
ParseHTML: boolean - if true, parse HTML page for links to files
Proxy: string - if non-blank, an HTTP proxy server
ProxyPort: string - port for proxy server

Repl: TFileCopyRepl - see above
ReplRO: boolean - true, replace read only files
LogFiles: boolean - true to log each file downloaded
LogProt: boolean - true to log HTTP protocol
LogLDir: boolean - true to log local file directory
LogRDir: boolean - true to log remote file directory

Main functions:

function Download (CheckFiles: boolean): TTaskResult ;

If CheckFiles is true it skips the actual download just returning a list of the URLs and parsed files selected for downloading, with file records in SrcFiles and the sorted pointers in SrcFileList, if CopyState is FCStateSelect the file has been selected for downloading.

If CheckFiles is false, the selected URLs and parsed files will be downloaded, with the result showing success or otherwise. Several properties are completed with various totals processed: TotProcFiles, ProcOKFiles, ProcFailFiles and SkippedFiles. The file records in SrcFiles and the sorted pointers in SrcFileList are updated with the success or failure of each file downloaded, although logging will normally have been done on a file by file basis through the CopyEvent.


procedure Cancel ;

This method will cancel downloads.

Installation

ICS v8 must be installed first, this must generally be the latest snapshot version from: http://wiki.overbyte.eu/wiki/index.php/FAQ or ICS V8,

Build and install the MagentaSubsx.BPL package library file, where x is the compiler version, 2006/2007 (v11), 2009 (v12), 2010 (v14), XE (v15), XE2 (v16), XE3 (v17), XE4 (v18), XE5 (v19), XE6 (v20), XE7 (v21), XE8 (v22) 10 Seattle (v23), 10.1 Berlin (v24) and 10.2 Tokyo (v25).

The various File Transfer Components packages that may be built are as follows:

v4.x - Delphi 7 - MagentaXfer7Run.dpk uses ICS v8 OverbyteIcsD7Run
v4.x - Delphi 2007 - MagentaXfer2007Run.dpk uses ICS v8 OverbyteIcsD2007Run
v4.x - Delphi 2009 - MagentaXfer2009Run.dpk uses ICS v8 OverbyteIcsD2009Run
v4.x - Delphi 2010 - MagentaXfer2010Run.dpk uses ICS v8 OverbyteIcsD2010Run
v4.x - Delphi XE - MagentaXferXERun.dpk uses ICS v8 OverbyteIcsDXERun
v4.x - Delphi XE2 - MagentaXferXE2Run.dpk uses ICS v8 OverbyteIcsDXE2Run
v4.x - Delphi XE3 - MagentaXferXE3Run.dpk uses ICS v8 OverbyteIcsDXE3Run
v4.x - Delphi XE4 - MagentaXferXE4Run.dpk uses ICS v8 OverbyteIcsDXE4Run
v4.x - Delphi XE5 - MagentaXferXE5Run.dpk uses ICS v8 OverbyteIcsDXE5Run
v4.x - Delphi XE6 - MagentaXferXE6Run.dpk uses ICS v8 OverbyteIcsDXE6Run
v4.x - Delphi XE7 - MagentaXferXE7Run.dpk uses ICS v8 OverbyteIcsDXE7Run
v4.x - Delphi XE8 - MagentaXferXE8Run.dpk uses ICS v8 OverbyteIcsDXE8Run
v4.x - Delphi 10 Seattle - MagentaXferD10SRun.dpk uses ICS v8 OverbyteIcsD10SRun
v4.x - Delphi 10.1 Berlin - MagentaXferD101Run.dpk uses ICS v8 OverbyteIcsD101Run
v4.x - Delphi 10.2 Tokyo - MagentaXferD102Run.dpk uses ICS v8 OverbyteIcsD102Run


v4.xW - Delphi 2007 - MagentaXfer2007W.dpk uses ICS v8 OverbyteIcsD2007Design

There are separate design and run time packages that must both be built, and the design time package installed onto the Component palette.

With Delphi XE3 and later, it's possible to install ICS for use with both VCL and FMX, using different run time packages. If this is done, the MagentaXferXExRun.dpr and MagentaXferXExDesign.dpr packages need to have OverbyteIcsDXExRun changed to IcsVclDXExRun.

Note that that MagentaXfer2007W also installs widestring versions of the ICS FTP client and server components to support Unicode under Delphi 2007.

Please note we don't supply packages for C++ Builder and can not support it.

Release Notes

Release 4.6 - 6 March 2017
Simplified SSL certificate reporting.
Set SSL security level low, ideally should be configurable.
Minor fixes to work with Delphi 10.2 Tokyo


Release 4.5 - 7 Dec 2016
More friendly errors.
Fixed an HTTP bug that caused an exception with ICS V8.37.
Force latest OpenSSL from our directory.
Only works with latest digitally signed OpenSSL DLLs using OpenSSL certificate verification host checking.
Removed TX509Ex now using TX509Base.
Using OpenSSL certificate verification host checking.
Set SSL session caching correctly.
Only check and report SSL certificates once per session.


Release 4.4 - 19 April 2016
Fixed an FTP bug that always treated upload file names as lower case.


Release 4.3 - 23 Oct 2015
Report more certificate information
Failed certificate report error as last HTTP or FTP error
Warning, self signed certificates are not trusted
Fixed HTTPS cert checking corrupting download file name


Release 4.2 - 13th Jul 2015
Requires ICS V8.18 June 2015 or later.
Better SSL handshake reporting.
Added SSL server certificate checking.
Added manifest so Windows 10 version displays correctly.


Release 4.1 - 24th July 2013
Fixed bug in WaitUntilReady that meant some sync methods with multiple commands randomly terminated prematurely allowing further commands to be sent usually resulting in not ready errors, reproduced with resumed uploads.


Release 4.1 - 11th June 2013
Added IgnorePaths to SelectCopyFileList and TMagFileCopy to ignore files where source has specific partial path, list is c:\temp;c:\temp2\;c:\temp3\;etc, or destination for deletion matches partial path.
Added Wow64RedirDisable property for Win64 allow all files to be copied correctly from Win32.
Added new ProgressEvent which passes TCopyProgress record updated for progress of current file and session including total bytes copied allowing percentage progress display.
Using TMagStringBuild to build listings instead of TMemoryStream.
When checking copy, use TMagStringBuild for improved listing performance.
Default to allowing IPv4 or IPv6 host names.
Demo3 application updated with 'Show Extended Progress' to demo the new progress event (but you could use a progress bar), 'Ignore Directory' and 'Disable WOW64 Redirect' for TMagFileCopy and TMagFtp.


Release 4.0 - 24th August 2012
Updated to support ICS V8 with IPv6. Note ICS V8 uses a new directory structure
Now log time and speed of each download
Most file sizes now reported in Kbytes. Mbytes, Gbytes instead of bytes
Demo adds Replace tickbox for HTTP, multiple HTTP URLs allowed
Added NoProgress property to skip LogLevelProg progress log events
HTTP supports 64-bit downloads
Using a larger HTTP winsock buffer for increased performance
Slow down HTTP progress updates for better performance
Updates subroutines for support with Delphi XE3.


Release 3.7 - 20th August 2011
Included various ICS changes, new throttling, zlib 1.2.5.
Support MultiThreaded using TIcsWndControl.MessagePump instead of Application.ProcessMessages
Some checksum Info logging should only have been File logging.
Added TMagFtpThread component which runs TMagFtp in a thread, tested with 250 threads running together.
Added NoProgress property to skip LogLevelProg progress log events.
Copy FTP empty directories if EmptyDirs property set.
Now registered in MagentaXferReg, separate design and run time packages.
Fixed bug listing sub-directories from root with MLSD command.
Updates subroutines for Win64 support with Delphi XE2.



Release 3.5 - 13th August 2010

Fix a problem parsing UNIX file listing with strange upper case file attributes
Fixed various string casts for D2009 and later

Release 2.7 - 13th August 2010
Fix a problem parsing UNIX file listing with strange upper case file attributes
Fixed various string casts for D2009 and later


Release 3.4 - 19th May 2009
Don't ignore failed MD5/XMD5 command but report error, prefer MD5 to XMD5.
Added MaskLocDir and MaskRemDir flags to take masked directory from SrcFName and add to local and/or remote directory, typically for dated directories.
Unicode now supported for MD5sum and CRC32B, add magftpNoMd5 and magftpNoCrc to allow them to be tested separately.
Updated OverbyteIcsFtpcliW with latest changes, added ftptest.org hosts.
Updated the packages using ICS v7 to support the new package names introduced in December 2008, please see Installation above.


Release 2.6 - 19th May 2009
Don't ignore failed MD5/XMD5 command but report error, prefer MD5 to XMD5.
Updated the packages using ICS v7 to support the new package names introduced in December 2008, please see Installation above.


Release 3.2 - 19th November 2008
Added TMagFtp3 and Xferdemo3 which support ICS V7.02 and later.
TMagFtpW renamed TMagFtp3W, TMagCopyW renamed TmagCopy3W, TMagHttpW renamed TMagHttp3W, which all support ICS V7.02W and later.
TMagFtp3 and TMagFtp3W support XDMLSD and XCLMSD commands.
TMagFtp3W all FTP display events now UnicodeString
Xferdemo3W now keeps last 50 FTP host names and HTTP URLs and uses the TNT Unicode controls to display Unicode with Delphi 2007.
Three executable demos are included, xferdemo3a.exe was built with Delphi 2007 with an ANSI GUI, xferdemo3u.exe with Delphi 2009 and displays Unicode file names, and xferdemo3W with Delphi 2007 and also displays Unicode file names


Release 2.5 - 18th November 2008
TMagFtp fixed PASS argument not being sanitised.
TMagCopy fixed FmtFileDirList with D2009.
Two executable demos are included, xferdemo2a.exe was built with Delphi 2007 with an ANSI GUI, xferdemo2u.exe with Delphi 2009 and displays Unicode file names


Release 3.1 - 22nd October 2008
Note this version has not been tested with Delphi 7.
TMagXfer now includes some custom ICS units modified for use with Unicode with Delphi 2007, OverbyteIcsFtpcliW, OverbyteIcsFtpSrvWT, OverbyteIcsFtpSrvW and OverbyteIcsFtpSrvWC (note the FTP server is only partially done) and and ics-internet sub-directory with matching demo applications. Currently, these components are created in code for TMagXfer and the ICS demos, so don't need to installed in a package.
FmtFileDirListW and FmtFileDirW are now Unicode, but probably D2007 or later due to the use of WideFormat.
In TMagFileCopyW, ensure the Progress event is called during copying of first file, and when copying starts rather than after 2 secs.
The IgnoreFileExt property may now include file extensions that are a minimum two characters instead of four.
Fixed an FTP bug if PWD returned blank rather than '/' (Indy).


Release 3.0 - 22nd September 2008
TMagCopy Unicode version unit renamed MagentaCopyW with TMagFileCopyW Support Unicode file listing and copying with Delphi 7 and later, all parameters are passed as WideStrings, but the events only show full Unicode characters with Delphi 2009.
DeleteEmptyDirs takes UStringArray arg for widestrings, not StringList.
New SrcDirUList and TarDirUList props as UStringArray to set Unicode dirs.
TMagHttp Unicode version unit renamed MagentaHttpW with TMagFileHttpW but does not support Unicode file names
TMagFtp Unicode vesion unit renamed MagentaFtpW with TMagFtpW
Support UTF8 FTP commands and file listings with ICS v7 only
Added magftpNoUtf8 property to turn off UTF8, and magftpIgnoreUtf8 if server will not turn it off
Support Unicode file listing and xfers with Delphi 7 and later, all parameters are passed as WideStrings, but the events only show full Unicode characters with Delphi 2009.
Check file names only have ANSI characters unless UTF8 is enabled.
Send HOST command before logon unless magftpNoHost specified (for virtual FTP servers)
Two executable demos are included, xferdemo3a.exe was built with Delphi 2007 with an ANSI GUI, xferdemo3u.exe with Delphi 2009 and displays Unicode file names


Release 2.4 - 22nd September 2008
All components support SSL as standard.
TMagCopy supports Unicode file listing and copying with Delphi 2007 and earlier, but directory parameters must be passed as ANSI.
TMagFtp adds magftpNoUtf8 property to turn off UTF8 if the server defaults to UTF8 (as does FileZilla).
Don't attempt to access files or directories with Unicode substitution ? character
Don't keep upload resume files unless some data actually sent
Don't attempt to upload _xxx.ftp resume files
Uploading always allowed to create the base directory, and it now works
Workaround for WS_FTP MLST with 501 Invalid number of arguments with spaces by quoting file name
SSL send PBSZ before PROT to keep MS FTP7 happy
Two executable demos are included, xferdemo2a.exe was built with Delphi 2007 with an ANSI GUI, xferdemo2u.exe with Delphi 2009 and displays
Unicode file names


Release 2.3 - 18th August 2008
Updated for latest ICS V6 and V7 for Delphi 2009 and Unicode
Replaced RX FormStorage with local INI file support so RX does not need be installed
Updated TMagCopy to fully support Unicode file names with Delphi 2009
No longer supplying compiled DCUs, since the component is now free.


Release 2.2 - 3rd March 2008
The demo application has a Clear logs button, several new FTP tick boxes, Bandwidth Limiting.
FTP MSLD fix for Serv-U where it only listed directories and no files
New FTP NoFeatCmd property which stops FEAT command being sent where servers have not implemented features 'correctly' causing FTP to fail
FTP uses the ALLO command to check space on server before uploads
FTP sends CLNT client string on logon
FTP uses SITE DMLSD command to list directories including subdirectory and SITE CMLSD for single dirs (ICS FTP server only at present)
LookupFTPReq and LookupFTPState moved to TFtpCli
FTP uses XMD5 command if MD5 not available
FTP logs time taken by MD5/CRC commands
FTP adds File/Delim logging for failed MD5/CRC on download and report MD5/CRC error for upload failed (not FTP response)
FTP no longer uses ModeZ for directory listing, except recursive
FTP adds ZlibNoCompExt property which is list of file extensions which should not use Mode Z, defaults to '.zip;.rar;.7z;.cab;.lzh;.gz;.avi; .wmv;.mpg;.mp3;.jpg;.png;'
FTP adds ZlibMaxSize property maximum file size for Mode Z (servers may struggle with large files)
FTP does not attempt to resume xfer if partial file larger than new file
FTP does not repeatedly abort as errors reported, which may cause problem with Zlib errors
FTP adds MaxResumeAttempts property, default 10 (was fixed 5)
FTP adds MaxXferAttempts property, default 3
FTP check if download tmp file already open, and uses tmp2 instead
FTP check more than MinResSize downloaded for file size mismatch in case file is smaller on resume
FTP downloads now gets server file size/date before each repeat attempt in case changed during the xfer
If FTP passive connection fails, Abort xfer so server cleans up
FTP now retries on 501 errors
Added MagFtpOps property to disable advanced features: magftpNoFeat, magftpNoZlib, magftpNoMd5Crc, magftpNoTmpFile
For FTP uploads, when no new files to upload, still delete old target files, and warn if ignoring delete old target files

Note this release needs an ICS V6 release dated March 2008 or later


Release 2.1 - 17th August 2007
Tested with Delphi 2007 which is the same packages as 2006
Fixed bug where FTP directory listings failed after a resumed download was aborted (bug in ICS FTP, but fixed here as well)
Fixed bug where MLSD listings ignore single character dirs and files


v2.0 only supports ICS V6 dated November 2006 or later, and is only supported on Delphi 7 and 2006. 


v1.9 fixes FTP 64-bit downloads. This version only support ICS V5 (not the new V6) and needs various new files that are in the ics folder, or an ICS release dated November 2006 or later is used.  Added new MagentaSubs package with common files. Object code support for Delphi 2005 dropped.


v1.8 fixes FTP failed resumed downloads, KeepAliveSecs for FTP, better error messages, added FTP XCRC command.  This version only support ICS V5 (not the new V6) and needs various new files that are in the ics folder, unless an ICS release dated 6th August 2006 or later is used.


v1.7 fixes FTP bugs with a server that returned non-standard MLST responses (now ignored) and another that returned strange MLSD responses (directory names instead of . and ..).  Also supports ICS SSL v5g from 9th March 2006.   The latest ICS beta contains all the components needed by these components, so all ICS files have been removed from the source distribution.


v1.6 is a test beta version that supports the new ICS SSL v5 components for both HTTP and FTP (but without certificate checking), the new HTTP content encoding for GZIP compressed web pages, and FTP Mode Z for compressed uploads and downloads.  The various new beta ICS components are including in a sub-directory, that should be copied over a current ICS beta installation. 

Please note the FTP client mode Z support currently compresses the file fully before upload starts, or decompresses after download has finished.  I've written code to compress and decompress during actual transfer, but it's suppressed and needs fully debugging (which I won't have time to do for a few days). Beware that compression on large files can dramatically reduce performance, a 35 meg zip took four minutes to compress and download (from both FileZilla server and Serv-U) , but only five seconds without compression.  So the TMagFtp component turns off compression (with the Mode S command) before transferring zip files.  An alternative might be to issue a new Opts command with no compression, OPTS MODE Z LEVEL 0.  Also note FtpCli.pas will be better documented when finished and ZLIB functions will be moved to be new unit to be shared with the FTP server.

Copyright Information

Magenta Systems File Transfer Components are copyrighted software but may be used without cost.


Magenta Systems Ltd, 9 Vincent Road, Croydon CR0 6ED, United Kingdom
Phone 020 8656 3636, International Phone +44 20 8656 3636
Fax 020 8656 8127, International Fax +44 20 8656 8127
https://www.magsys.co.uk/
Copyright © 2017 Magenta Systems Ltd, England. All Rights Reserved.