FTP

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi - has anyone seen, or point me in the direction of an asp.net (vb)
ftp script? I'm not really interested in all the bells and whistles -
just a case of pointing to a site directory, and downloading all of the
files and folders to a local drive - keeping the directory structure
intact?

Thanks for any pointers, Mark
 
http://www.gotdotnet.com/Community/...mpleGuid=DD5E4A38-7F5B-45E0-9C36-64B987947C20

This is an excellent ftp class.

Sample code:

Dim objFTP As New FTP
Dim myDir, NewPath As String

myDir = Path.GetDirectoryName(strFullPath) & "\"

'rename existing file before downloading new copy
If File.Exists(strFullPath) = True Then
NewPath = myDir & Format(Now(), "yyyyMMddHHmmss") & " " &
Path.GetFileName(strFullPath)
're-name the file
File.Move(strFullPath, NewPath)
End If

objFTP.RemoteHost = strSite
objFTP.RemotePath = strSiteDir
'slashes are optional at beginning and end of RemotePath!
objFTP.RemoteUser = strUID
objFTP.RemotePassword = strPwd
objFTP.RemotePort = 21

If objFTP.Login() = True Then
objFTP.SetBinaryMode(True)
objFTP.DownloadFile(strSiteFileName, strFullPath)
'if file exists, it is overwritten without warning.
End If
 
Mark said:
Hi - has anyone seen, or point me in the direction of an asp.net (vb)
ftp script? I'm not really interested in all the bells and whistles -
just a case of pointing to a site directory, and downloading all of the
files and folders to a local drive - keeping the directory structure
intact?

http://www.indyproject.org/

Has full fTP support, and there is nothing that has as comprehensive support
for FTP as Indy does. It even parses something like 40 differnet file
systems.

And its free. ;)


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com
 
Back
Top