Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

donalding subdirectores /files from the server using VB

Status
Not open for further replies.

pujas

Programmer
Feb 2, 2005
22
0
0
US
Hi all,

I'am trying to download files using VB from a host http machine.
Currently i'am using inet.openurl(" to get one file at a time.
I wanted to know a way of getting all the files in the dir and also getting all subdirectores.

Any pointers in the right direction would be really really helpful..

Thanks in advance
 
Put the files in the directory into an array, then use a loop to retrieve all the files in the array.

Lee
 
I'am not sure how to implement what you said.
I have a folder called xyz which is on a host machine.
xyz contains 1 or 2 files and 2 or 3 subdirectories. Nothing is static. It could contain as many files and folder in the dir. The subfolders also have files and other folder and so on.

when i use inet1.opneurl ("i get a result which has <a href= "path of next folder or file> in them as i'am opening a folder and not a file

what i need to do is get all the files and sub folders/subfolders/files in xyz into my local machine in a similar way as its stroed in the host machine.

the code right now i'am using for getting 1 file from host and copying on my machine c:\

Set Inet = CreateObject("InetCtls.Inet.1")
Inet.Protocol = icHTTP
Dim bytRet() As Byte
Dim strDate As String
Dim intCnt As Integer
bytRet = Inet.OpenUrl(" ' icByteArray)
Do While Inet.StillExecuting ' Waiting
DoEvents
Loop
Open "c:\xyz.txt" For Binary Access Write As #fn
Put #fn, , bytret()
DoEvents
Close the open file
Close #fn

I need a solution to recursively copy all the files and folders from the host to my client machine
 
Thanks for letting me know. Just posted my query there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top