ftp

FTP.FTP

FTP.FTP(aHost, aPort, aLogin, aPass, isFTPS, isImplicit, aProtocol, isPassive, isBinary, aTimeout) : FTP

Creates an instance of a FTP/FTPS client (and connects) given a host, port, login username and password.
Alternatively you can provide a FTP/FTPS url where aHost = ftp://user:pass@host:port/?timeout=1234&passive=true&binary=true
or ftps://user:pass@host:port/?timeout=1234&passive=true&binary=true&implicit=false&protocol=TLS.

See also the $ftp shortcut in the [scope reference](/docs/reference/scope.html) for a more convenient chainable JavaScript API.

FTP.cd

FTP.cd(aPath)

Changes the remote directory to the corresponding path.

FTP.close

FTP.close()

Closes the FTP/FTPS connection.

FTP.get

FTP.get(aRemoteFilePath, aLocalFilePath) : String

Retrieves a file, using the FTP/FTPS connection, from aRemoteFilePath to aLocalFilePath.
Use FTP.getBytes in case you are reading a binary file into memory.

FTP.getBytes

FTP.getBytes(aRemoteFile) : anArrayOfBytes

Returns an array of bytes with the contents of aRemoteFilePath, using the FTP/FTPS connection.

FTP.getFTPClient

FTP.getFTPClient() : Object

Obtains the internal FTP/FTPS client.

FTP.ftpGet

FTP.ftpGet(aRemoteFile, aLocalFile) : JavaStream

Retrieves a remote file over the FTP/FTPS connection to be stored on the local path provided. If aLocalFile is
not provided the remote file contents will be returned as a Java Stream.

FTP.ftpPut

FTP.ftpPut(aSource, aRemoteFile)

Sends aSource file (if string) or a Java stream to a remote file path over a FTP/FTPS connection.

FTP.listFiles

FTP.listFiles(aPath) : Map

Returns a files array where each entry has filename, longname, filepath, size, permissions, lastModified,
createTime, isDirectory and isFile.

FTP.mkdir

FTP.mkdir(aPath)

Tries to create a remote directory for the provided aPath.

FTP.put

FTP.put(aSourceFilePath, aRemoteFilePath)

Copies aSourceFilePath to aRemoteFilePath, using the FTP/FTPS connection.

FTP.putBytes

FTP.putBytes(aRemoteFilePath, bytes)

Writes an array of bytes on aRemoteFilePath, using the FTP/FTPS connection.

FTP.pwd

FTP.pwd() : String

Returns the current remote path.

FTP.rename

FTP.rename(aOriginalName, aNewName)

Renames a remote original filename to a newname.

FTP.rm

FTP.rm(aFilePath)

Removes a remote filename at the provided aFilePath.

FTP.rmdir

FTP.rmdir(aPath)

Removes a remote directory at the provided aPath.

FTP.setBinaryMode

FTP.setBinaryMode(isBinary)

Switches between binary and ascii file transfer mode.

FTP.setPassiveMode

FTP.setPassiveMode(isPassive)

Switches between passive and active mode.

FTP.setTimeout

FTP.setTimeout(aTimeout)

Sets aTimeout in ms for the FTP/FTPS connection.

This site uses Just the Docs, a documentation theme for Jekyll.