MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system


TMsgClient.ReceiveFile
TMsgClient
Top 

Receives a file with progress indicator support.

function ReceiveFile(FileID: Cardinal; const FileName: String; TimeOut: Integer = 0): Integer;

Description

Call ReceiveFile to Receive a file.

FileID is an unique idetifier of a file.
FileName - name of the file to store without path.
TimeOut - time in milliseconds for which ReceiveFile will wait for the whole file to arrive.

ReceiveFile waits for all blocks to arrive for the time specified by TimeOut parameter (in msec), then saves file with name specified by FileName parameter.

You must set FileID to specify the file to receive. You can determine FileIDs of receiving files in event handler OnReceiveFile.

If TimeOut parameter <= 0, it will be set to MAXINT value.

If ReceiveFile is finished successfully, it returns the size of received file in bytes; otherwise it returns one of the following negative error codes:
Name
Value
MSG_Error_ReceiveFile_NotExists
MSG_Error_ReceiveFile_DiskFull
MSG_Error_ReceiveFile_FileExists
MSG_Error_ReceiveFile_CannotCreateFile
MSG_Error_ReceiveFile_TimeOut
MSG_Error_ReceiveFile_BlockSize
-1
-2
-3
-4
-5
-6



© AidAim Software MsgCommunicator: