This method downloads a file on the remote server to a byte array

[Visual Basic] Public Function FtpDownloadFileToByteArray(ByVal remoteAddress As System.Uri) As Byte()
[C#] public byte[] FtpDownloadFileToByteArray(System.Uri remoteAddress);

Parameters

remoteAddress

The URI to the download file 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 a file on the remote server to a byte array

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(New Uri("ftp://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(new Uri("ftp://www.newtone.co.jp/test/test.jpg"));

See Also

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

 

The ImageKit WPF is created by Newtone Corporation