ftp/Connect.pl

#///////////////////////////////////////////////////////////////////////////////////
#//
#// DownloadFile
#//
#// Purpose: 
#//   Downloads a single file from one remote server to your local computer.
#//
#// Technical support: support@smartftp.com
#//
#// Copyright (c) by SmartSoft Ltd.
#//
#///////////////////////////////////////////////////////////////////////////////////
use strict;
use Win32::OLE;
use Win32::OLE::Variant;
$| = 1;

package Test;
my $ftp = Win32::OLE->new('sfFTPLib.FTPConnectionMTA');

$ftp->{Host} = "ftp.smartftp.com";
$ftp->{Port} = 21;
$ftp->{Username} = "anonymous";
$ftp->{Password} = "test\@test.com";
$ftp->{Passive} = 1;
$ftp->{MLST} = 1;
$ftp->{Protocol} = 0;

$ftp->Connect();
print("Connected to server\n");
if($ftp->ChangeDirectory("/SmartFTP");
print("ChangeDirectory() successful.\n");
$ftp->DownloadFile("License.txt", "License.txt", 0, 0);