The instructions from our vendor require us to upload files using the following command in MS DOS FTP: PUT filename CUSTOMER_UPLD!FTP
Here's my attempt to do this using the rebex ftp component, but I get a 450 error returned: File Not Available. Please advise on how this command (CUSTOMER_UPLD!FTP) can be sent with the PutFile method of the ftp object. If the command is not sent, then the files just sit in the inbound directory of the remote server (likely a mainframe since it won't allow batch uploads) and are not picked up.
Sub UploadFTPFiles(ByVal LocalDir As String, ByVal User As String, ByVal Psw As String, ByVal Server As String, ByVal Port As Integer, ByVal FilePath As String)
Dim client As New Ftp
Dim FileDir As New DirectoryInfo(LocalDir)
Dim fiClaimFiles() As FileInfo
Dim fi As FileInfo
Dim sArchPath As String
AddHandler client.CommandSent, AddressOf client_CommandSent
AddHandler client.ResponseRead, AddressOf client_ResponseRead
With client
.Connect(Server, Port)
.Login(User, Psw)
.TransferType = FtpTransferType.Binary
.Passive = False
fiClaimFiles = FileDir.GetFiles
For Each fi In fiClaimFiles
.PutFile(fi.FullName, FilePath + fi.Name + " CUSTOMER_UPLD!FTP")
'Archive the file if sent successfully
sArchPath = LocalDir + "Archive\" + fi.Name
fi.MoveTo(sArchPath)
Next
.Disconnect()
End With
End Sub