Ftp

Ftp

new Ftp(params) → {Ftp}

Source:
Create an instance of the Ftp class.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
host string Which host to connect to.
port number <optional>
__client.getDefaultPort() Typically 21
username string <optional>
'' -
password string <optional>
'' -
binaryTransfer boolean <optional>
true Use binaryTransfer?
hidden boolean <optional>
false -
localActive boolean <optional>
false False means to use passive mode.
useEpsvWithIPv4 boolean <optional>
false -
keepAliveTimeout number <optional>
-1 -
controlKeepAliveReplyTimeout number <optional>
-1 -
encoding string <optional>
null -
Returns:
- Instance of the ftp class
Type
Ftp

Methods

connect() → {Ftp}

Source:
Connect to the ftp server using the params set during Ftp object construction.
Returns:
- Instance of the ftp class
Type
Ftp

disconnect() → {Ftp}

Source:
Disconnect from the ftp server you are connected too.
Returns:
- Instance of the ftp class
Type
Ftp

getNames(params) → {Array.<string>}

Source:
Get a list of files on a path on the ftp server.
Parameters:
Name Type Description
params Object
Properties
Name Type Description
remote string Path on the ftp server.
Returns:
-
Type
Array.<string>

login() → {Ftp}

Source:
Login on the ftp server you are connected too.
Returns:
- Instance of the ftp class
Type
Ftp

logout() → {Ftp}

Source:
Logout from the ftp server you are connected too.
Returns:
- Instance of the ftp class
Type
Ftp

retrieveFile(params) → {string}

Source:
Retrieve a file from the ftp server.
Parameters:
Name Type Description
params Object
Properties
Name Type Description
remote string Path on the ftp server.
Returns:
- Contents of the file as text
Type
string