Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

November 13, 2007

How do I FTP download to a specific local directory?

Question:
I’m using the FTP Activex. you only have examples of changing the remote directory.. How do I download to a specific local directory?

Answer:

The GetFile method accepts two arguments, a remote filename, and a local filename:

bool GetFile(string remoteFilename,  string localFilename);

The localFilename can include a path, relative or absolute. For example:

success = ftp2.GetFile("test.txt","c:/temp/test.txt");
success = ftp2.GetFile("test.txt","../xyz/test.txt");

If you don’t include a path for the localFilename, the file will appear in the calling process’s current working directory.

Note: Any Chilkat method that accepts a filename for an argument can be considered to implicitly accept an absolute or relative filepath as well.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.