SendFile Method

Sends a file to the specified client.

Syntax

int SendFile(int iConnectionId, const QString& qsClientSFIDCode, const QString& qsFileName, const QString& qsVirtualFileName);

Remarks

This method sends a file to the client specified by the ConnectionId parameter.

After the ReadyToSend event fires or when the OFTPConnectionReadyToSend property is true, this method can be used to send a file to the connected client specified by the ConnectionId parameter.

The ClientSFIDCode corresponds to the destination.

FileName must be the full path to the file which will be sent.

VirtualFileName may be specified to indicate the name of the file that the client will see when receiving the file.

If ConnectionsUploadStream is set, pass empty string as the value for the FileName parameter.

When this method is called, the class will fire the StartTransfer, Transfer, and EndTransfer events that can be monitored to check the status of the send. The SendFile method will not return until either the transfer is complete or an error was encountered.

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Qt Edition - Version 20.0 [Build 8203]