ESLWEB Function
Transfer a file to or from a FTP Server.
FTPFile( FTP_SV,
FTP_Action,
FTP_RemoteFile_SV,
FTP_LocalFile_SV,
FTP_Userid_SV,
FTP_Password_SV)
Parameters
FTP_SV
A string containing the name of the FTP server.
FTP_Action
An integer set to one of the following actions:
FTPGet |
Retrieve the specified file from the Host. |
FTPGetWithOverwrite |
Retrieve the specified file from the Host, overwriting the existing local file is needed. |
FTPPut |
Upload the specified file to the Host. |
FTPPutWithOverwrite |
Upload the specified file to the Host, overwriting any existing remote file. |
FTP_LocalFile_SV
A string containing the name of the file on the workstation; to be sent to the Host, created or overwritten with the file received from the Host.
FTP_RemoteFile_SV
A string containing the name of the file on the Host; to be transferred to the workstation, created or overwritten with the file sent from the workstation.
FTP_Userid_SV
The User identifier for the FTP server. This can be a NULL string, if the server supports anonymous login.
FTP_Password_SV
The Password credential for the User identifier. This can be a NULL string, if the server supports anonymous login.
Returns
An ESL integer containing one of the following responses:
FTP_E_ERRORFREE |
No errors encounter the transfer was successful. |
FTP_E_LOGINDENIED |
The login requires User Id and Password credentials. |
FTP_E_BADPASSWORD |
The login credentials are not valid. |
FTP_E_NOLOCAL |
The local file has not be specified. |
FTP_E_BADACTION |
Unrecognized action specified. |
FTP_E_BADLOCALFILE |
Local Source File does not exist. |
FTP_E_BADREMOTEFILE |
Remote Source File does not exist. |
FTP_E_CANTWRITE |
Target File is write-protected. |
FTP_E_NOREMOTE |
Remote File has not been specified. |
FTP_E_REMOTEFILEEXISTS |
Remote Target File exists but overwrite not specified. |
FTP_E_LOCALFILEEXISTS |
Local Target File exists but overwrite not specified. |
FTP_E_CONNECTIONFAILED |
Connection lost before transfer complete. |
FTP_E_SERVERNOTFOUND |
Specified Server could not be resolved. |
FTP_E_BADLOCALPATH |
Local Target File path does not exist. |
FTP_E_BADREMOTEPATH |
Remote Target File path does not exist. |
FTP_E_DISKFULL |
Disk has no more space for writing target file. |
FTP_E_FILELOCKED |
File locked by another program. |
FTP_E_NOSERVER |
Server not specified. |
FTP_E_BADSERVER |
Server parameter incorrect. |
FTP_E_CONNECTION_ERROR |
Failed to connect to the specified Server |
FTP_E_ERROR |
Unknown error has occurred. |
Description
This function uses the internet standard File Transfer Protocol (FTP) to copy files between the workstation and a specified Server. Only the Active transfer mode is supported, so you may find that this function is incompatible with your firewall settings. The files are transferred as binary, so any type of file content is supported.
As any relative path used to specify a file will be dependent on the Current Directory, it is recommend that the full (Absolute) path be used.
If the function fails, as well as the return value being non-zero, there is also an error message recorded in the errorlog.