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

See Also

Ftp Class | Ftp Members

 

The ImageKit.NET X is created by Newtone Corporation