This method uploads a byte array to a file on the remote server specified by a host name and path.
[Visual Basic] Public Function
UploadByteArrayToFile(ByVal remoteHost As String, ByVal remotePath
As String, ByVal data As Byte()) As Boolean
[C#] public bool UploadByteArrayToFile(string
remoteHost, string remotePath, byte[] data);
Parameters
remoteHost
DNS style domain name or IP address
remotePath
Path to the file on the remote server
data
Data in byte array
Return Value
Returns True if successful, otherwise returns False
Explanation
The UploadByteArrayToFile method uploads a byte array to a file on the remote server specified by a host name and path.
This method is enabled for FTP protocol.
Example
[Visual Basic.NET]
Dim _ftp As New Newtone.ImageKit.Ftp
Dim Ret As Boolean
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
Ret = _ftp.UploadByteArrayToFile("www.newtone.co.jp", "test/test.jpg", data)
[Visual C#.NET]
Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp();
bool Ret;
//Username and password
_ftp.Credentials = new NetworkCredential("user", "password");
//Passive mode
_ftp.Passive = true;
Ret = _ftp.UploadByteArrayToFile("www.newtone.co.jp", "test/test.jpg", data);
Dim _ftp As New Newtone.ImageKit.Ftp
Dim Ret As Boolean
'Username and password
_ftp.Credentials = New NetworkCredential("user", "password")
'Passive mode
_ftp.Passive = True
Ret = _ftp.UploadByteArrayToFile("www.newtone.co.jp", "test/test.jpg", data)
[Visual C#.NET]
Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp();
bool Ret;
//Username and password
_ftp.Credentials = new NetworkCredential("user", "password");
//Passive mode
_ftp.Passive = true;
Ret = _ftp.UploadByteArrayToFile("www.newtone.co.jp", "test/test.jpg", data);
See Also