Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Internet Transfer Control

Status
Not open for further replies.

Stuartp

Technical User
Feb 22, 2001
178
GB
I am trying to use the Inet control in vb6 to download a database from an FTP site. I can connect to the server OK, and it says it is connected, but the command to retrive the file just doesn't seem to do anything.

I am using the command
Inet1.Execute , "GET database.mdb C:\database.mdb"

But nothing happens. What else do I need to do please?

Thanks

Stuart
 
OK, I've got it to download a file from the remote server, but i can only download from the root folder. If I try to download a file from a sub folder, even after using the CD command to change folders, I get a 550 file not found error.

Here is the code I have so far:

Code:
Private Sub Command1_Click()

With Inet1
    .Cancel
    .Protocol = icFTP
    .URL = "[URL unfurl="true"]www.myurl.com"[/URL]
    .UserName = "user"
    .Password = "pass"
End With

Inet1.Execute , "CD /data"

Do While Inet1.StillExecuting
    DoEvents
Loop

Inet1.Execute , "GET pwlang2.txt C:\downloaded.txt"



End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)


Select Case State
    Case icResponseCompleted
    Case icError
        MsgBox Inet1.ResponseInfo, vbCritical, "Error"
        
    Case 3
    End Select

End Sub

Hope someone can point me in the right direction with this

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top