I can't make it work... Can you put some example information for me to see how it works? Thanks
Main Topics
Browse All TopicsHi, I want to know how can I use the Inet control to upload files (FTP).
I saw something like:
Inet1.Execute "PUT"
But it doesn't work...
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OK, sorry about that. URL is put together by the Inet control, its just an ftp path which includes the remotehost, which is just the name of the server. Here is a fully working example (except the username & password are changed):
Private Sub Form_Load()
Debug.Print UploadFile("ftp.tripod.com
End Sub
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
With Inet1
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " & LocalFileName & " " & RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
End Function
Oh and yes, I'm using the code exactly the way it is:
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
With Inet1
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " & LocalFileName & " " & RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
End Function
Private Sub Form_Load()
Debug.Print UploadFile("ftp.xx.xxx", "user", "password", "C:\file.txt", "files\file.txt")
End Sub
Business Accounts
Answer for Membership
by: YohanShmingePosted on 2004-06-28 at 06:09:12ID: 11415235
Greetings HyMaX,
Try this:
Function UploadFile(ByVal HostName As String, _
ByVal UserName As String, _
ByVal Password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
Dim FTP As Inet
Set FTP = New Inet
With FTP
.Protocol = icFTP
.RemoteHost = HostName
.UserName = UserName
.Password = Password
.Execute .URL, "Put " LocalFileName " " RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
Set FTP = Nothing
End Function
Yohan