MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system
Receives a file with progress indicator support.
function ReceiveFile(FileID: Cardinal; const FileName: String; TimeOut: Integer = 0): Integer;
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: