Skip to content

FTPClient » Download

Download a remote file from the ftp server. Returns true if the download was successful or false otherwise.

js
client.Download(remotePath, localPath);
client.Download(remotePath, localPath);

Parameters

  • remotePath - The remote path to download.
  • localPath - The local path where the downloaded file will be.

Example

js
let client = ftp.Connect(
    "sftp", 
    "example.domain.com", 
    22, 
    "brad", 
    "password"
); 

if (client.IsConnected()) { 
    let result = client.Download('/remote/path/README.md', '/local/README.md'); 
    console.log("Downloading file result: " + result);
}
let client = ftp.Connect(
    "sftp", 
    "example.domain.com", 
    22, 
    "brad", 
    "password"
); 

if (client.IsConnected()) { 
    let result = client.Download('/remote/path/README.md', '/local/README.md'); 
    console.log("Downloading file result: " + result);
}