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

[Visual Basic] Public Function DownloadFileToByteArray(ByVal remoteAddress As String) As Byte()
[C#] public byte[] DownloadFileToByteArray(string 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 DownloadFileToByteArray 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("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("ftp://www.newtone.co.jp/test/test.jpg");

See Also

Ftp Class | Ftp Members

 

</html The ImageKit.NET3 is created by Newtone Corporation