Reflection
INDReceiveFile Method
Example 


Specifies a name for the PC file to receive the host data. Include complete path information.
Specifies a host file.
Specifies what type of file is being transferred.
Specifies what to do if the file specified in the pcFile argument already exists
Use true to display the Transfer in Progress window while the transfer is in progress, or false to not display the Transfer in Progress window.
Transfers a file from the host to the PC using the IND$FILE protocol.
Syntax
'Declaration
 
Sub INDReceiveFile( _
   ByVal pcFile As String, _
   ByVal hostFile As String, _
   ByVal type As INDFileTransferType, _
   ByVal fileExistsOption As FileExistsOption, _
   ByVal showStatus As Boolean _
) 
'Usage
 
Dim instance As IFileTransfer
Dim pcFile As String
Dim hostFile As String
Dim type As INDFileTransferType
Dim fileExistsOption As FileExistsOption
Dim showStatus As Boolean
 
instance.INDReceiveFile(pcFile, hostFile, type, fileExistsOption, showStatus)

Parameters

pcFile
Specifies a name for the PC file to receive the host data. Include complete path information.
hostFile
Specifies a host file.
type
Specifies what type of file is being transferred.
fileExistsOption
Specifies what to do if the file specified in the pcFile argument already exists
showStatus
Use true to display the Transfer in Progress window while the transfer is in progress, or false to not display the Transfer in Progress window.
Remarks

If you're having trouble getting a transfer to work, make sure the XfrHostSys property is set to the appropriate value.

Example
This sample gets a file from the host. Before you run the sample, make sure the cursor is on a TSO command line.
void ReceiveFileTransfer()
{
    Application app = MyReflection.ActiveApplication;
    IFrame frame = (IFrame)app.GetObject("Frame");
 
    IView view = (IView)frame.SelectedView;
 
    IIbmTerminal terminal = (IIbmTerminal)view.Control;
 
    Attachmate.Reflection.Emulation.IbmHosts.IFileTransfer fTransfer = terminal.FileTransfer;
 
    fTransfer.XfrHostSys = HostSystem.Tso;
 
    fTransfer.INDReceiveFile(@"C:\Users\Public\Documents\countReceived.txt", "count.txt", INDFileTransferType.Ascii, FileExistsOption.Append, true);
 
}
See Also