Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3/4 Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Node.js) Download Directory TreeDownload a directory tree from an FTP server, re-creating it on the local filesystem.
var os = require('os'); if (os.platform() == 'win32') { var chilkat = require('chilkat_node10_win32'); } else if (os.platform() == 'linux') { if (os.arch() == 'arm') { var chilkat = require('chilkat_node10_arm'); } else if (os.arch() == 'x86') { var chilkat = require('chilkat_node10_linux32'); } else { var chilkat = require('chilkat_node10_linux64'); } } else if (os.platform() == 'darwin') { var chilkat = require('chilkat_node10_macosx'); } function chilkatExample() { var ftp = new chilkat.Ftp2(); var success; // Any string unlocks the component for the 1st 30-days. success = ftp.UnlockComponent("Anything for 30-day trial"); if (success !== true) { console.log(ftp.LastErrorText); return; } ftp.Hostname = "ftp.something.com"; ftp.Username = "test"; ftp.Password = "test"; // Connect and login to the FTP server. success = ftp.Connect(); if (success !== true) { console.log(ftp.LastErrorText); return; } // Set the current remote directory to the root of // the tree to be downloaded. // success = ftp.ChangeRemoteDir("/something"); // if (success != cktrue) { // println ftp.LastErrorText; // return; // } // Download the entire tree, recreating it at c:/temp/something success = ftp.DownloadTree("c:/temp/something2"); if (success !== true) { console.log(ftp.LastErrorText); return; } success = ftp.Disconnect(); } chilkatExample(); |
© 2000-2016 Chilkat Software, Inc. All Rights Reserved.