Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Download Online Documents via HTTP

    Hi,

    I'm looking to download all documents in a Directory of a website (i'm doing this for may sins an a Access 2007 Module).

    For Example http://www.samplesite.com/documents

    I can get individual documents, where the name is known using the code below:

    Set objHTTP = New http
    Path1 = 'url to file

    With objHTTP
    .HttpURL = Path1
    .PromptWithCommonDialog = False
    If .FileExists Then
    .DestinationFile = 'Path to save location
    End If
    .ConnectToHTTPHost
    .WriteHTTPDataToFile
    End With
    Set objHTTP = Nothing


    However what I'm looking to do is parse an online directory using a similer method to the one you'd use with a File System Object See below sample.

    Dim Fsys As New FileSystemObject
    Set ThisFolder = Fsys.GetFolder("C:\Folderpath")
    Set Allfiles = ThisFolder.Files

    For Each File In Allfiles
    Handle File here
    Next


    Anyone got any hints/ideas. NB: I cant seem to get: "path/*.*" to work

    Than-You

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    I don't think http includes a keyword/command for listing a directory, but ftp does. Since Access has access to the full power of the Windows API, not just scripting APIs, you should be able to find or cobble together something to get a directory. Perhaps these older articles will help?

    Using the Internet Transfer Control > Issuing FTP Commands
    SAMPLE: Using FTP WinInet APIs in Visual Basic with SimpleFtp
    SAMPLE: VBFTP.EXE: Implementing FTP Using WinInet API from VB

  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Your input is much appreciated (and interesting) I'll peruse them later, however i've used a basterdized method, which involves link harvesting from index pages that has solved my problem. Just needed to focus, which sometimes only comes from lounging.

Posting Permissions

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