Uploads a byte array to the FTP server remote directory.

Namespace: Jscape.Ftp
Assembly: Jscape.Ftp (in Jscape.Ftp.dll) Version: 2.4.5.0

Syntax

C#
public virtual void Upload(
	byte[] data,
	string remoteFile
)
Visual Basic
Public Overridable Sub Upload ( _
	data As Byte(), _
	remoteFile As String _
)
Visual C++
public:
virtual void Upload(
	array<unsigned char>^ data, 
	String^ remoteFile
)

Parameters

data
Type: array<System..::..Byte>[]()[][]
The byte array to upload.
remoteFile
Type: System..::..String
The destination filename for the upload.

Examples

The following example uploads a byte array to the remote directory on the FTP server.
CopyC#
byte[] array = Encoding.Default.GetBytes("This is a test.\r\n");
myFtp.Upload(array, "test.txt");

Copy 
Dim array As Byte() = System.Text.Encoding.Default.GetBytes("This is a test." + vbCrLf)
myFtp.Upload(array, "test.txt")

Exceptions

ExceptionCondition
Jscape.Ftp..::..FtpExceptionIf an I/O or FTP error occurs.

See Also