Topic Path: Symbol Reference > Classes > TIdFTP Class > TIdFTP Methods > VerifyFile Method > VerifyFile Method (String, String, Int64, Int64)
ContentsIndexHome
PreviousUpNext
TIdFTP.VerifyFile Method (String, String, Int64, Int64)

Compares all or part of the specified local and remote files for verified transfer integrity.

function VerifyFile(
    const ALocalFile: String; 
    const ARemoteFile: String; 
    const AStartPoint: Int64 = 0; 
    const AByteCount: Int64 = 0
): Boolean; overload;
Parameters 
Description 
ALocalFile 
Name of the file on the local file system.
 
ARemoteFile 
Name of the file on the remote FTP server.
 
AStartPoint 
Initial position for comparing the local and remote files. Default value is 0.
 
AByteCount 
Number of bytes to use for the checksum calculation. Default value is 0. 

Boolean - True when the local and remote files are the same.

VerifyFile is an overloaded method used to compare all or part the contents of the specified local and remote files as part of the extensibility features for verified transfer integrity. 

VerifyFile can be used to determine the integrity of a file transfer using one of the following checksum algorithms: 

 

Algorithm 
Description 
XSHA 
SHA-1 checksum 
XMD5 
MD5 checksum 
XCRC 
CRC-32 checksum 

 

One of the algorithms must be listed in the Capabilities for the FTP server, or VerifyFile cannot determine the checksum value on the remote FTP server. 

VerifyFile selects the algorithm using the following preferred order: 

 

XSHA 
XMD5 
XCRC 

 

Internally, VerifyFile uses an instance of TIdHashMessageDigest5, TIdHashSHA1, or TIdHashCRC32 to calculate the checksum value for the contents of the local file using the ALocalFile argument. 

AStartPoint indicates the initial position in the files to use when calculating the checksum values. When AStartPoint contains 0 (zero) or a positive Integer value, the stream in ALocalFile is positioned to to that location prior to starting the checksum calculation. 

AByteCount indicates the number of bytes to include when performing the checksum calculation. The default value is 0, and indicates that the byte count should be derived from the size of the stream for the local file and the initial position indicated in AStartPoint. 

VerifyFile calls an overloaded variant of the method to build and send an FTP command using an algorithm name and arguments as required for the operation. The checksum value from the remote FTP server is captured and compared to the value calculated for the local file. VerifyFile returns True when the local checksum and the remote checksum values are the same. VerifyFile returns False when the checksum values are not the same, or when the capability is not supported on the remote FTP server. 

Use SupportsVerification to determine if the FTP server support the extensibility feature.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.