Online Help
FTPS is an action plugin that can be used to connect to secure FTP servers, and exchange files.
Changes to a specific folder on the remote FTP server.
(string) The path to the directory on the FTP server that you want to navigate to.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.ChangeDir("/www/cgi-bin/");
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not change to the folder. ("..error..")");
end
Connects to a secure FTP server, establishing an explicit SSL (AUTH SSL/TLS) connection.
(string) The hostname or IP address of the FTP server to connect to.
(string) The username to be used on the FTP connection.
(string) The password to be used.
(number) The port to connect to. This can be any port, like 21.
(boolean) The transfer mode for the files. Passive is more compatible, try it first. Change to active if a firewall blocks the transfer. true = passive, false = active.
(boolean) Specifies binary or text mode file transfers. Use true = ASCII mode, false = binary transfers. Unless you transfer text between Windows and Unix/Linux, use binary.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.ConnectExplicit("192.168.0.14", "Admin", "password", 21, true, false);
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not open FTP connection. ("..error..")");
end
Connects to a secure FTP server, establishing an implicit SSL (AUTH SSL/TLS) connection.
(string) The hostname or IP address of the FTP server to connect to.
(string) The username to be used on the FTP connection.
(string) The password to be used.
(number) The port to connect to. Implicit SSL normally uses port 990, but this can be any port, like 21.
(boolean) The transfer mode for the files. Passive is more compatible, try it first. Change to active if a firewall blocks the transfer. true = passive, false = active.
(boolean) Specifies binary or text mode file transfers. Use true = ASCII mode, false = binary transfers. Unless you transfer text between Windows and Unix/Linux, use binary.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.ConnectImplicit("192.168.0.14", "Admin", "password", 21, true, false);
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not open FTP connection. ("..error..")");
end
Deletes one file on the remote FTP server.
(string) The file to be deleted in the current directory on the FTP server.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.Delete("index.html");
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not delete the file. ("..error..")");
end
Closes an open connection to a remote secure FTP server gracefully.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
-- finishes data exchange with remote server result = FTPS.Disconnect();
Downloads a file from remote FTP server.
(string) The name of the remote file to be downloaded.
(string) The name for the local file.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.Download(filename, "C:\\TEMP\\downloaded-" .. filename);
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not download file. ("..error..")");
end
Renames one file on the remote FTP server.
(string) The current filename of the file.
(string) The new filename of the file in the current directory on the FTP server.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
res = FTPS.Rename("test.html", "newindex.html");
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not rename the file. ("..error..")");
end
Uploads a local file to the remote FTP server.
(string) The full path to the file to be uploaded.
(string) The name to be used for the remote file.
(number) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.
filename = "file-" .. System.GetDate(DATE_FMT_ISO) .. System.GetTime(TIME_FMT_MIN) .. System.GetTime(TIME_FMT_SEC) .. ".file";
res = FTPS.Upload("C:\\TEMP\\mytestfile.doc", filename);
if (res ~= 0) then
error = Application.GetLastError();
Dialog.Message("FTPS", "Could not upload file. ("..error..")");
end
12001 - Internal error.
12002 - Could not connect to FTP server.
12003 - Not connected to FTP server.
12004 - Could not change to specified remote folder.
12005 - Could not upload file. No permission?
12006 - File not found.
Ulrich Peters
upeters@mindquake.com.br
Plugin is copyright © 2008 MindQuake Serviços de Informática Ltda.
Copyright © 2008 MindQuake Serviços de Informática Ltda.
Todos os direitos reservados.