-
Apr 7th, 2014, 07:28 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Downloading with Internet Transfer Control!
Hey guys...
I actually know how to upload a file to FTP server :
Code:
Private Sub CmdUpload_Click()
With Inet1
.URL = "ftp://ftp.Mysite.com"
.UserName = "My FTP account Username"
.Password = "My FTP account Password"
.Execute , "PUT C:\Sample.txt/Sample.txt"
End With
End sub
How can i change the code to download instead of uploading ?!
What about this ?! is it correct :
Code:
Private Sub CmdDownload_Click()
With Inet1
.URL = "ftp://ftp.Mysite.com"
.UserName = "My FTP account Username"
.Password = "My FTP account Password"
.Execute , "GET File-in-server.txt " & " /" & "C:\1.txt"
End With
End sub
Thanks for further guidance!
Last edited by GlowingVB; Apr 7th, 2014 at 10:10 AM.
-
Apr 7th, 2014, 11:16 PM
#2
Addicted Member
Re: Downloading with Internet Transfer Control!
Review this thread and it gives you details and some options in case you run into problems.
http://www.vbforums.com/showthread.p...et-not-working
-
Apr 8th, 2014, 12:28 AM
#3
Re: Downloading with Internet Transfer Control!
Code:
'
'
Dim LocalPath As String
Dim RemotePath As String
LocalPath = Chr(34) & "C:\testfolder\mytextfilename.txt" & Chr(34)
RemotePath = Chr(34) & "/somewebsite/mytextfilename.txt" & Chr(34)
With MyForm.Inet1
.AccessType = icDirect
.Protocol = icFTP
.UserName = "username"
.Password = "password"
.RemoteHost = "www.somewebsite.com"
.Execute .URL, "GET " & RemotePath & " " & LocalPath
While .StillExecuting
DoEvents
Wend
.Execute , "CLOSE"
End With
'
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Apr 8th, 2014, 10:50 AM
#4
Thread Starter
Addicted Member
Re: Downloading with Internet Transfer Control!
Thanks . The problem is solved!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|