This method downloads a file on the remote server to a byte array
[Visual Basic] Public Function
FtpDownloadFileToByteArray(ByVal remoteAddress As String) As
Byte()
[C#] public byte[]
FtpDownloadFileToByteArray(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 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("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("ftp://www.newtone.co.jp/test/test.jpg");
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("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("ftp://www.newtone.co.jp/test/test.jpg");
See Also
ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit