InfoConnect API Guide
Attachmate.Reflection.Emulation.IbmHosts Namespace / IFileTransfer Interface / INDSendFile Method
Specifies a local file. Provide complete path information or the file can be found only if it's in the current directory to be found.

You cannot use wildcard characters to send multiple files, as you can when you use the Transfer screen.

Specifies a name for the file being transferred. This name must comply with naming conventions for host files. You cannot use an empty string.
Specifies what type of file is being transferred.
Specifies what to do if the file specified in the HostFile 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.
Example


In This Topic
    INDSendFile Method
    In This Topic
    Transfers a file from the PC to the host using the IND$FILE protocol.
    Syntax
    'Declaration
     
    
    Sub INDSendFile( _
       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.INDSendFile(pcFile, hostFile, type, fileExistsOption, showStatus)

    Parameters

    pcFile
    Specifies a local file. Provide complete path information or the file can be found only if it's in the current directory to be found.

    You cannot use wildcard characters to send multiple files, as you can when you use the Transfer screen.

    hostFile
    Specifies a name for the file being transferred. This name must comply with naming conventions for host files. You cannot use an empty string.
    type
    Specifies what type of file is being transferred.
    fileExistsOption
    Specifies what to do if the file specified in the HostFile 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 sends a file to the host. Before you run the sample, make sure the cursor is on a TSO command line.
    void SendFileTransfer()
    {
        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.INDSendFile(@"C:\Users\Public\Documents\test.txt", "bvtst02.test7.txt", INDFileTransferType.Ascii, FileExistsOption.Overwrite, true);
     
    }
    See Also