FTP actions

Used to upload and download files to and from a remote FTP server.

ftpGET

Download files from a remote FTP server

Parameter Description
FtpConfig Configuring the FTP parameters
FtpRemoteFileName File name on the remote FTP server to download (source)
FtpLocalFileName File name on local HMI device (destination)
ftpPUT

Upload files to a remote FTP server

Parameter Description
FtpConfig Configuring the FTP parameters
FtpLocalFileName File name on local HMI device (source)
FtpRemoteFileName File name on the remote FTP server to download (Destination)

Filenames can contain wildcards.

When transferred, system variables are updated with the status of ongoing operations (see "FTP client variables"for details).

FTP Server Configuration

To configure the FTP parameter, enter the following information for the FtpConfig setting:

Parameter Description

FTP Address

FTP server IP Address

Server Port

Port for FTP connection (default = 21).

Authentication

Select the FTP authentication to use:

  • Normal (Username and password required)
  • Anonymous

User Name

Username of the remote FTP account

Password

Password of the remote FTP account

Click + to add more FTP servers configuration.

Tip: Use tags if you want change the server parameters dynamically from the JMobile HMI Runtime.

FTP JavaScript Interface
ftpConfig

ftpCONFIG (IPAddress, Port, Authentication, UserName, Password)

Set the FTP parameters to use on next FTP calls

Parameter Description
IPAddress

FTP server IP Address.

Port

Port for FTP connection (default = 21).

Authentication

Select the FTP authentication to use:

  • Normal (Username and password required)
  • Anonymous
UserName

Username of the remote FTP account

Password

Password of the remote FTP account

ftpGET

ftpGET (remoteFileName, localFileName, [callback])

Download files from a remote FTP server

Parameter Description
remoteFileName File name on the remote FTP server to download (source)
localFileName File name on local HMI device (destination)
callback Function that will be call at the end of the FTP transfer
ftpPUT

ftpPUT (localFileName, remoteFileName, [callback])

Upload files to a remote FTP server

Parameter Description
remoteFileName File name on the remote FTP server to download (source)
localFileName File name on local HMI device (destination)
callback Function that will be call at the end of the FTP transfer

Example:

project.ftpCONFIG("192.168.0.200", "21", "true", "admin", "admin");

project.ftpGET( "data.txt",
                "\\USBMemory\\data.txt",
                function(ftpStatus) {fnFtpGetFinished(ftpStatus);} );

function fnFtpGetFinished(ftpStatus) {    
	 alert(ftpStatus);   
}