Protocols/MSNP/Activities/SDK/Techref/Objectmodel/Objects/Channel/Methods/SendFile: Difference between revisions
Jump to navigation
Jump to search
Animadoria (talk | contribs) (Created automatically by Anima Importer) |
Animadoria (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<!-- Generated @ 08/12/2022 23:45:58 +01:00 using Anima's CHM converter based on techref/objectmodel/objects/channel/methods/SendFile.htm --> | <!-- Generated @ 08/12/2022 23:45:58 +01:00 using Anima's CHM converter based on techref/objectmodel/objects/channel/methods/SendFile.htm --> | ||
{{Protocols/MSNP|section=Activities}} | {{Protocols/MSNP|section=Activities}} | ||
__NOTOC__= | __NOTOC__= [[Protocols/MSNP/Activities/SDK/Techref/Objectmodel/Objects/Channel/Index|Channel]].SendFile Method (Restricted) = | ||
This method transfers a file to the remote application. The method takes a <span class="clsMethod">FileInfo</span> object created through an ActiveX® control. The ActiveX control must provide the user an interface to browse and select a file to transfer. It is the responsibility of the developer to provide this ActiveX control. The method is labeled "restricted" because it is only available if the application has the ActiveX and SendFile permission flags. For more information, see [[Protocols/MSNP/Activities/SDK/Sandbox|Standard vs. Advanced Applications]]. | This method transfers a file to the remote application. The method takes a <span class="clsMethod">FileInfo</span> object created through an ActiveX® control. The ActiveX control must provide the user an interface to browse and select a file to transfer. It is the responsibility of the developer to provide this ActiveX control. The method is labeled "restricted" because it is only available if the application has the ActiveX and SendFile permission flags. For more information, see [[Protocols/MSNP/Activities/SDK/Sandbox|Standard vs. Advanced Applications]]. | ||
VBScript Syntax | === VBScript Syntax === | ||
<div class="clsCodeStd"> | <div class="clsCodeStd"> | ||
Line 23: | Line 23: | ||
:Handler | :Handler | ||
Document.Write("SendFile failed. Error Description: " & err.description) | Document.Write("SendFile failed. Error Description: " & err.description) | ||
End Sub | End Sub</pre> | ||
</div> | </div> | ||
JavaScript Syntax | === JavaScript Syntax === | ||
<div class="clsCodeStd"> | <div class="clsCodeStd"> | ||
Line 43: | Line 42: | ||
document.write("SendFile failed. Error Description: " + ex.description); | document.write("SendFile failed. Error Description: " + ex.description); | ||
} | } | ||
} | }</pre> | ||
</div> | </div> | ||
Parameters | === Parameters === | ||
; pdFileInfo | ; pdFileInfo | ||
: A <span class="clsObject">FileInfo</span> object that contains the path to the file to be sent. | : A <span class="clsObject">FileInfo</span> object that contains the path to the file to be sent. | ||
Return Values | === Return Values === | ||
Returns a <span class="clsObject">FileInfo</span> object that contains the properties of the file transfer. | Returns a <span class="clsObject">FileInfo</span> object that contains the properties of the file transfer. | ||
Remarks | === Remarks === | ||
An exception is thrown if the application does not have both the ActiveX and SendFile permissions, or if the parameter does not correspond to a valid file object. | An exception is thrown if the application does not have both the ActiveX and SendFile permissions, or if the parameter does not correspond to a valid file object. |
Latest revision as of 01:34, 13 August 2022
Channel.SendFile Method (Restricted)
This method transfers a file to the remote application. The method takes a FileInfo object created through an ActiveX® control. The ActiveX control must provide the user an interface to browse and select a file to transfer. It is the responsibility of the developer to provide this ActiveX control. The method is labeled "restricted" because it is only available if the application has the ActiveX and SendFile permission flags. For more information, see Standard vs. Advanced Applications.
VBScript Syntax
set myChannel = external.Channel ' An ActiveX control is required to access a local file set myFileWrapper = myActiveX.getfile(myFileName) sub cmdSendFileButton_OnClick On Error Goto Handler myFileTracker = myChannel.SendFile(myFileWrapper) ' myFileTracker is now a FileInfo object Exit Sub :Handler Document.Write("SendFile failed. Error Description: " & err.description) End Sub
JavaScript Syntax
myChannel = window.external.Channel; function cmdSendFileButton_OnClick() { // An ActiveX control is required to access the local file try { var myFileWrapper = myActiveX.getfile(); myFileTracker = myChannel.SendFile(myFileWrapper); // myFileTracker is now a FileInfo object } catch(ex) { document.write("SendFile failed. Error Description: " + ex.description); } }
Parameters
- pdFileInfo
- A FileInfo object that contains the path to the file to be sent.
Return Values
Returns a FileInfo object that contains the properties of the file transfer.
Remarks
An exception is thrown if the application does not have both the ActiveX and SendFile permissions, or if the parameter does not correspond to a valid file object.