Send comments on this topic.
INDSendFile Method
Attachmate.Reflection.Objects.Emulation.IbmHosts Library > FileTransfer Object : INDSendFile Method
pcFile
Specifies a local file. Unless you provide complete path information, only files in the current directory will be found. You cannot use wildcard characters to send multiple files the way you can by using the Transfer screen.
hostFile
Specifies a name for the transferred file that complies with host file-naming conventions. You cannot use an empty string.
type
Specifies the type of file being transferred.
fileExistsOption
Specifies what to do if the file specified in the HostFile argument already exists.
showStatus
Displays the file transfer in the Progress window if set to true.
Transfers a file from the PC to the host using the IND$FILE protocol.

Syntax

 
object.INDSendFile( 
   ByVal pcFile As String,
   ByVal hostFile As String,
   ByVal type As INDFileTransferType,
   ByVal fileExistsOption As FileExistsOption,
   ByVal showStatus As Boolean
) 

Parameters

pcFile
Specifies a local file. Unless you provide complete path information, only files in the current directory will be found. You cannot use wildcard characters to send multiple files the way you can by using the Transfer screen.
hostFile
Specifies a name for the transferred file that complies with host file-naming conventions. You cannot use an empty string.
type
Specifies the type of file being transferred.
fileExistsOption
Specifies what to do if the file specified in the HostFile argument already exists.
showStatus
Displays the file transfer in the Progress window if set to true.

Exceptions

ExceptionDescription
System.InvalidOperationExceptionThe exception that is thrown when a method call is invalid for the object's current state.

Example

This sample sends a file to the host. Before you run the sample, make sure the cursor is on a TSO command line.
Copy Code
Sub FileTransferSendSample()
 
    path = Environ$("USERPROFILE") & "\Documents\Attachmate\Reflection\" & "test.txt"
    
    'Set the configuration to TSO
    ThisIbmTerminal.FileTransfer.XfrHostSys = HostSystem_Tso
    
    ThisIbmTerminal.FileTransfer.INDSendFile path, "bvtst02.test7.txt", INDFileTransferType_Ascii, FileExistsOption_Overwrite, True
    
End Sub

Remarks

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

See Also