FileReceive

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloConnection > TApolloConnection Methods >

FileReceive

Declaration

function FileReceive( sDatabaseName, srcFile, desFile: String ): Integer;

Description

Transfers a file (any file) from the remote server to the client. The source file (srcFile) must be located in the remote server directory associated with the sDatabaseName parameter. The file will be copied to the local (client) directory and file name specified in the desFile parameter. Use the FileExists method to insure that the remote file exists.

Parameters

sDatabaseName is the remote database name where the source file is located.

srcFile is the name of the source file to be copied from the server.

desFile is the name of the destination file to be created on the local machine. This parameter may include the drive and path information.

Returns

The number of bytes received are returned as an Integer. Use the FileLength method to determine the size of the remote file to validate the download result.

Delphi Example

procedure TForm1.Button1Click(Sender: TObject);

begin

 with ApolloConnection1 do 

 begin 

         Active := True; 

         if FileReceive( 'SAMPLEDATA', 'TEST.DBF', 'C:\Apollo\MyTest.dbf' ) <> FileLength ( 'SAMPLEDATA', 'TEST.DBF' ) then 

                 ShowMessage( 'Error receiving file!' ); 

 end; 

end;

See Also

FileSendFileSend, FileLengthFileLength, FileExistsFileExists, DatabaseNameTApolloConnection_DatabaseName