PDA

Click to See Complete Forum and Search --> : How to Download Multiple File(s) from a Protected FTP Site...


lvramanan
Jun 16th, 2001, 11:14 PM
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 :cool:

jim mcnamara
Jun 17th, 2001, 10:06 AM
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

open ftp.whatever.com
username
password
lcd c:\localpath
cd remotepath
asc
mget *.*
bye


vb 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

lvramanan
Jun 17th, 2001, 11:05 AM
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.
:(

Olly
Jun 17th, 2001, 02:10 PM
Look it up here:

http://www.planetsourcecode.com/xq/ASP/txtCodeId.6469/lngWId.1/qx/vb/scripts/ShowCode.htm

lvramanan
Jun 17th, 2001, 10:17 PM
Hi Olly,
I got the code. I'll see to it and meet u later. Anyway thanks to all u guys...:)

Olly
Jun 19th, 2001, 12:46 PM
And also look here, this is even better (originally posted by ATommasi in http://www.vbforums.com/showthread.php?s=&threadid=83900)
http://www.vbecstasy.com/showdld.asp?id=26&pg=1

lvramanan
Jun 19th, 2001, 09:10 PM
Hi Olly,
Got all the Code. I'll mail you after trying them. Thanks a Lot man.... :cool: