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 FtpDownloadFileToByteArray 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 Data As Byte()
'Username and password
ImageKit.File.FtpCredentials = New NetworkCredential("user", "password")
'Passive mode
ImageKit.File.FtpPassive = True
'Downloads the file to byte array
Data = ImageKit.File.FtpDownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg")

[Visual C#.NET]

byte[] Data;
//Username and password
ImageKit.File.FtpCredentials = new NetworkCredential("user", "password");
//Passive mode
ImageKit.File.FtpPassive = true;
//Downloads the file to byte array
Data = ImageKit.File.FtpDownloadFileToByteArray("www.newtone.co.jp", "test/test.jpg");

See Also

ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit

 

The ImageKit WPF is created by Newtone Corporation