ePages 7.48.0 - DE_EPAGES/Core/API/FTP.pm

Package DE_EPAGES::Core::API::FTP

Wrapper over WWW::Curl::Easy

Functions

connect
connectionDataOK
getFile
listFiles
message
new
putFile
renameFile

connect

Connect to a FTP server

Syntax
$ftp->connect($Url,$username,$password);
Input
$Url (string)
FTP server Url
$username (string)
FTP server login username
$password (string)
FTP server login password

connectionDataOK

Check if connection data is setup OK

Syntax
$ftp->connectionDataOK;
Return
$retcode (int)
1 if successful

getFile

Get a file from a FTP url once the connection is created

Syntax
$ftp->getFile($LocalFileName,$RemoteFileName);
Input
$LocalFileName (string)
Name of the file in local system (Absolute Path!)
$RemoteFileName (string)
Name of the file in FTP url (Absolute Path!)

listFiles

List the files,links,directories,... that exist in $Directory of FTP server

Syntax
@aReturnFiles = $ftp->listFiles($Directory);
Input
$Directory (string)
Name of the directory in FTP server (Absolute Path!)
Return
@aReturnFiles (array)
list of file names without path

message

Returns the description of the return code.

Syntax
$ftp->message($RetCode);
Input
$retcode (int)
Code to descript
Return
Error description (String)
Description of the last execution

new

Creates an empty DE_EPAGES::Core::API::FTP object

Syntax
$ftp->new();
Return
(DE_EPAGES::Core::API::FTP object)
FTP object

putFile

Send a file to a FTP url once the connection is created

Syntax
$ftp->putFile($LocalFileName,$RemoteFileName);
Input
$LocalFileName (string)
Name of the file in local system (Absolute Path!)
$RemoteFileName (string)
Name that the file will have in FTP server (Absolute Path!)

renameFile

Rename a file of the FTP server

Syntax
$ftp->renameFile($OldFileName,$NewFileName);
Input
$OldFileName (string)
Old Name of the file in FTP server (Absolute Path, without first '/')
$NewFileName (string)
New Name of the file in FTP server (Absolute Path, without first '/')