ActiveXperts Network Component Ftp and FtpFile Objects
Today, there are many FTP software packages available. However, most of these software tools are stand-alone packages, without scripting options. Network Component is very well suited for scripting and embedding in applications.
Use the Network Component Ftp object to script the following:
- Connect to a remote FTP server;
- Log on as an anonymous user, or log on using a login and a password;
- Change directory;
- Download files (ftp 'get'), ASCII or binary;
- Upload files (ftp 'put'), ASCII or binary;
The Ftp object is part of the Network Component. Overview of all Network Component objects:
DnsServer & DnsRecord - Ftp & FtpFile - Http - Icmp - IPtoCountry - Msn - Ntp - Radius - Rsh - Scp - SFtp - Ssh - SnmpManager - SnmpTrapManager - SnmpMibBrowser - Tcp - Tftp - TraceRoute - Udp - Xen - Wake-on-LAN - Xen (Citrix)
Ftp Sample code
VBScript sample: Ftp directory listing sample
Set objFtp = CreateObject ( "ActiveXperts.FtpServer" ) objFtp.Connect "ftp.activexperts-lab.com" , "", "" WScript.Echo "Connect, result: " & objFtp.LastError If( objFtp.LastError <> 0 ) Then WScript.Quit End If WScript.Echo objFtp.GetCurrentDir Set objFtpFile = objFtp.FindFirstFile() While ( objFtp.LastError = 0 ) WScript.Echo "File: " & objFtpFile.Name WScript.Echo " Size: " & objFtpFile.Size Set objFtpFile = objFtp.FindNextFile () Wend objFtp.Disconnect WScript.Echo "Ready."
You can download the full samples here.