Ftp

FTP-functions are addressed with

declare=lu_ftp=ue_api.ue_api_chilkat
lu_ftp.ftp.<command>=propertie
 
alternativ:
declare=lftp=ue_api_chilkat=ftp
lu_ftp.<command>=propertie

 

 

Command

Description

init

initialize the object

declare=lftp=ue_api_chilkat=ftp

lftp.init

 

con

Connect to ftp server

declare=lftp=ue_api_chilkat=ftp
lftp.init
lftp.con=HostName=UserName=Password

 

you can set all parameter before the con-command

declare=lftp=ue_api_chilkat=ftp
lftp.init
lftp.hostname=128.023.128.123
lftp.username=myname
lftp.password=abc
lftp.passiv=true
lftp.con
...
lftp.disconnect

connect

init and connect to ftp which is defined in settings in station setup

 

if nothing is set, using parameters

lftp.connect=HostName=UserName=Password

 

beas9.0-004-053 and later

you can set all parameter before the connect-command

 

isconnected

check if connected and displays message

connectionfailreason

display connection error key

port

set port

hostname

set hostname

username

set username

password

set password

passiv or ftppassiv

set the passive connection for ftp server (true/false)

createremotedir=<path>

create directory on remote

changeremotedir=<path>

change remote directory

download=<remotefile>=<local path>

download file

getfile=<local File>=<remote file>

download file

getremotefiletextdata=<remote file>

load file and return text in variable <value>

getremotefiletextc=<remote file>

load file (utf 8) and return text in variable <value>

getsize=<remotefile>

return file size in <value>

putfile=local file=remote file

send file

putfilefromtextdata=file name=<value>

send text to remote file

upload=local file=remote file

send file

dir=*.*

Returns a listing of the files and directories in the current directory matching the pattern. Passing "*.*" will return all the files and directories.

 

Returns Nothing on failure

return result in variable <ftpverzeichnis>

disconnect

disconnect from ftp

deletematching

Deletes all the files in the current remote FTP directory matching the pattern. Returns the number of files deleted, or -1 for failure. The pattern is a string such as "*.txt", where any number of "*" wildcard characters can be used. "*" matches 0 or more of any character.

deleteremotefile

If the remoteFilePath contains non-English characters, it may be necessary to set the DirListingCharset property equal to "utf-8". Please refer to the documentation for the DirListingCharset property.

deletetree

Deletes the entire subtree and all files from the current remote FTP directory. To delete a subtree on the FTP server, your program would first navigate to the root of the subtree to be deleted by calling ChangeRemoteDir, and then call DeleteTree. There are two event callbacks: VerifyDeleteFile and VerifyDeleteDir. Both are called prior to deleting each file or directory. The arguments to the callback include the full filepath of the file or directory, and an output-only "skip" flag. If your application sets the skip flag to true, the file or directory is NOT deleted. If a directory is not deleted, all files and sub-directories will remain. Example programs can be found at http://www.example-code.com/



 

Example

declare=lftp=ue_api_chilkat=ftp
lftp.init
lftp.connect=myserver.net=u76d20031=A55%OP1aL
lftp.putfile=c:\temp\myfile.txt=myfile.txt
lft.disconnect