This method downloads data on the FTP server with the specified host name, path name and port number to a local file.
[Visual Basic] Public Function
DownloadFile(ByVal remoteHost As String, ByVal remotePath As
String, ByVal remotePort As Integer, ByVal localFileName As String)
As Boolean
[C#] public bool DownloadFile(string
remoteHost, string remotePath, int remotePort, string
localFileName);
Parameters
- remoteHost
- Domain name in DNS style, or IP address
- remotePath
- The name of the remote path
- remotePort
- IP port number
- localFileName
- Local file name
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The DownloadFile method downloads data on the FTP server with the specified host name, path name and port number to a local file.
This method is effective for the FTP protocol.
Example
[Visual Basic.NET] Dim _ftp As New Newtone.ImageKit.Ftp Dim Ret As Boolean 'Username and password _ftp.Credentials = New NetworkCredential("user", "password") 'Enables passive mode connectivity _ftp.Passive = True 'Downloads the file Ret = _ftp.DownloadFile("www.newtone.co.jp", "test/test.jpg", 21, "c:\test\test.jpg") [Visual C#.NET] Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp(); bool Ret; //Username and password _ftp.Credentials = new NetworkCredential("user", "password"); //Enables passive mode connectivity _ftp.Passive = true; //Downloads the file Ret = _ftp.DownloadFile("www.newtone.co.jp", "test/test.jpg", 21, @"c:\test\test.jpg");