dcsimg
Results 1 to 4 of 4

Thread: [RESOLVED] Downloading with Internet Transfer Control!

  1. #1

    Thread Starter
    Addicted Member GlowingVB's Avatar
    Join Date
    Feb 2014
    Posts
    234

    Resolved [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.

  2. #2
    Addicted Member
    Join Date
    Jun 2006
    Location
    Texas
    Posts
    149

    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

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,073

    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.

  4. #4

    Thread Starter
    Addicted Member GlowingVB's Avatar
    Join Date
    Feb 2014
    Posts
    234

    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
  •  



Featured


Click Here to Expand Forum to Full Width