---SOLVED--- VB6: FTP by Inet: CONNECT and CD work, DIR and GET won't
My fault..
1.) I assumed DIR to get also sub directories. In fact, DIR gets only documents, not sub directories.
2.) I made a mistake in my GET string (see the "," after first parameter)
Nevertheless thanx for ur interest!
Hello Buddies,
can anyone help me with this simple code?? FTP connect with VB's inet component works, CD works, but DIR and GET won't work. Looks like FTP client doesn't see data on FTP server.
When I use my system's FTP client ftp.exe instead, DIR and GET seems to work properly. FTP server seems to be a unix server.
VB code:
Private Sub Form_Load()
With Inet1
.URL = myURL
.UserName = myUser
.Password = myPw
.Execute , "DIR"
Debug.Print "DIR1: " & .ResponseInfo
.Execute , "CD /my_directory"
Debug.Print "CD: " & .ResponseInfo
.Execute , "DIR"
Debug.Print "DIR2: " & .ResponseInfo
.Execute , "GET myTestDataWithALongName.doc, c:\temp\test.dat"
Debug.Print "GET: " & .ResponseInfo
End With
End Sub
Outline is:
DIR1: Es sind keine weiteren Dateien vorhanden. [No data found]
CD: Der Vorgang wurde erfolgreich beendet. [command successful]
DIR2: Es sind keine weiteren Dateien vorhanden. [No data found]
GET: 200 Type set to I.
200 PORT command successful.
550 Test.doc.NPRWE,: No such file or directory
550 Test.doc.NPRWE,: No such file or directory