Protocols/MSNP/Activities/SDK/Techref/Objectmodel/Objects/Channel/Methods/CancelSendFile
<a class="clsStd" href="/techref/objectmodel/objects/channel/index.htm">Channel</a>.CancelSendFile Method (Restricted)
This method cancels a file transfer in progress. The method is labeled "restricted" because it is only available if the application has the SendFile permission flag. For more information, see Standard vs. Advanced Applications.
VBScript Syntax
set myChannel = external.Channel sub cmdFileCancelButton_OnClick ' User clicked stop file transfer button On Error Goto Handler myChannel.CancelSendFile(myFile) Exit Sub :Handler Document.Write("CancelSendFile failed. Error Description: " & err.description) End Sub
JavaScript Syntax
myChannel = window.external.Channel; function cmdFileCancelButton_OnClick() { // User clicked stop file transfer button try { myChannel.CancelSendFile(myFile) } catch(ex) { document.write("CancelSendFile failed. Error Description: " + ex.description); } }
Parameters
- aSendFile
- A FileInfo type representing the file transfer to cancel.
Return Values
No return value.
Remarks
An exception is thrown if the application does not have SendFile permission, or if the parameter does not correspond to a file transfer.
If the active file transfer is canceled, and a file queue is set up, the next file in the queue begins transferring.
If more than one file is queued for transfer, each file must be canceled individually to clear the queue.