SteveMac32
Programmer
Hi all really hope you can help me out here..
I know Inet is not the best but this is protocols they use and they won’t let me change them...
That said I have been working on this for hours and about to give up, if only I could, I can’t seem to get or put files onto the sFTP site even though I have all the correct user name and p/w.
here is my code snippet
Private Sub FTPFile()
With frmInet.Inet1
.Protocol = icFTP
.RemoteHost = cHost
.UserName = cUser
.Password = cPassword
.RemotePort = "21"
.RequestTimeout = 500
If gblnImport Then
' as far as I know it goes to htl1x/in/ or at least it does when I connect through Filezilla
.Execute , "get models.txt \\global\Files\Imports\Temp_ImportData\ImportTest.txt"
Else
.Execute , "cd /htl1x/out/"
While .StillExecuting
DoEvents
Wend
.Execute , "put \\global\Files\Exports\Temp_ExportData\ExportTest.txt"
End If
End With
End Sub
When I add
'Read the data on the site
Dim vdata As Variant
.Execute , "DIR"
vdata = .GetChunk(1024, icString)
Debug.Print vdata
It returns all the correct data
I just can’t work out what is wrong any ideas, does the code look ok????
I know Inet is not the best but this is protocols they use and they won’t let me change them...
That said I have been working on this for hours and about to give up, if only I could, I can’t seem to get or put files onto the sFTP site even though I have all the correct user name and p/w.
here is my code snippet
Private Sub FTPFile()
With frmInet.Inet1
.Protocol = icFTP
.RemoteHost = cHost
.UserName = cUser
.Password = cPassword
.RemotePort = "21"
.RequestTimeout = 500
If gblnImport Then
' as far as I know it goes to htl1x/in/ or at least it does when I connect through Filezilla
.Execute , "get models.txt \\global\Files\Imports\Temp_ImportData\ImportTest.txt"
Else
.Execute , "cd /htl1x/out/"
While .StillExecuting
DoEvents
Wend
.Execute , "put \\global\Files\Exports\Temp_ExportData\ExportTest.txt"
End If
End With
End Sub
When I add
'Read the data on the site
Dim vdata As Variant
.Execute , "DIR"
vdata = .GetChunk(1024, icString)
Debug.Print vdata
It returns all the correct data
I just can’t work out what is wrong any ideas, does the code look ok????