This method downloads data in a byte array from the remote server specified by a host name and path.
[Visual Basic] Public Function
FtpDownloadFileToByteArray(ByVal remoteHost As String, ByVal
remotePath As String) As Byte()
[C#] public byte[]
FtpDownloadFileToByteArray(string remoteHost, string
remotePath);
Parameters
remoteHost
DNS style name or IP Address
remotePath
Path on the remote server
Return Value
Returns data in a byte array if successful, otherwise returns null (Nothing in Visual Basic)
Explanation
The DownloadFileToByteArray method downloads data in a byte array from the remote server specified by a host name and path.
This method is enabled for FTP protocol.
Example
[Visual Basic.NET]
Dim _ftp As New Newtone.ImageKit.Ftp
Dim Data As Byte()
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
'Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg")
[Visual C#.NET]
Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp();
byte[] Data;
//Username and password
_ftp.Credentials = new NetworkCredential("user", "password");
//Passive mode
_ftp.Passive = true;
//Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg");
Dim _ftp As New Newtone.ImageKit.Ftp
Dim Data As Byte()
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
'Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg")
[Visual C#.NET]
Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp();
byte[] Data;
//Username and password
_ftp.Credentials = new NetworkCredential("user", "password");
//Passive mode
_ftp.Passive = true;
//Downloads the file to byte array
Data = _ftp.DownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg");
See Also