Results 1 to 7 of 7

Thread: How to Download Multiple File(s) from a Protected FTP Site...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    India, Chennai
    Posts
    121

    Question How to Download Multiple File(s) from a Protected FTP Site...

    Hi Guys,
    I'm designing a APP that will contact a Protected FTP Site to check for file downloads. The System will be online 24 Hrs. My duty is to check for download of files in a Specified Directory (Say ftp://somesite.com/Downloads) I'm using the Inet Control to get and Send Files. I should download the files if any to a directory on Local Harddisk. How to download a file from the site. I know that I should use the GET Method to get a file. I get a Problem if I try to download more than One file. SO please specify me a method on how should I get the File(s) from the Site using the Inet Control. First of all is it Possible to get it with a Inet Control or anyother Method should be used. Any Help is welcome. Thanks in Advance

  2. #2
    jim mcnamara
    Guest
    We do this -- assuming you every file, you can use wildcards.
    ftp scripts allow you a lot of flexibiliity without having to write supporting code for every filename/pathname change

    ftp script
    Code:
    open ftp.whatever.com
    username 
    password
    lcd c:\localpath
    cd remotepath
    asc
    mget *.*
    bye
    vb code
    Code:
    Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    
    Sub ftpGet()
        Dim  WindowsDir as String, lSiz as Long, retval as Long 
        Dim cmd$
            WindowsDir = Space(255)
            retval = GetWindowsDirectory(WindowsDir,lSize)
            WindowsDir = left(WindowsDir,lSize)
            cmd$ = WindowsDir & "ftp -is:script.ftp"
            Shell cmd$,vbNormalFocus
    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    India, Chennai
    Posts
    121

    Can u Explain the Terms lcd, asc, mget, etc.,

    Hi Jim,
    Thanks for ur code. By the By I'm new to FTP. Can U explain me the terms a little bit detail. Actually what should we do. What's our command to get multiple files. Say Suppose My FTP Site contains *.wav file(s). Now What should I give to get the Wave Files to my Local Directory Say (c:\Downloads\). Here what's the use of GetWindowsDirectory API. Is it playing any Important Role here. Can u also Explain its use also. Please.... don't get upset of my Questions. Kindly Help. Thanks in advance.

  4. #4
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    Thumbs up I think I've found exactly what you need...


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    India, Chennai
    Posts
    121

    Thanks Olly I got it and meet u later...

    Hi Olly,
    I got the code. I'll see to it and meet u later. Anyway thanks to all u guys...

  6. #6
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    And also look here, this is even better (originally posted by ATommasi in http://www.vbforums.com/showthread.p...threadid=83900)
    http://www.vbecstasy.com/showdld.asp?id=26&pg=1

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    India, Chennai
    Posts
    121

    Thanks a Lot Olly...

    Hi Olly,
    Got all the Code. I'll mail you after trying them. Thanks a Lot man....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width