Uploads a byte array to the FTP server remote directory.
Namespace: Jscape.FtpAssembly: Jscape.Ftp (in Jscape.Ftp.dll) Version: 2.4.5.0
Syntax
C# |
---|
public virtual void Upload( byte[] data, string remoteFile, bool append ) |
Visual Basic |
---|
Public Overridable Sub Upload ( _ data As Byte(), _ remoteFile As String, _ append As Boolean _ ) |
Visual C++ |
---|
public: virtual void Upload( array<unsigned char>^ data, String^ remoteFile, bool append ) |
Parameters
- data
- Type: array<System..::..Byte>[]()[][]
The byte array to upload.
- remoteFile
- Type: System..::..String
The destination filename for the upload.
- append
- Type: System..::..Boolean
true to append to the remote file on the FTP server, false otherwise.
Examples
The following example uploads a byte array to the remote directory
on the FTP server.
CopyC#
Copy

byte[] array = Encoding.Default.GetBytes("This is a test\r\n"); myFtp.Upload(array, "test.txt", false);

Dim array As Byte() = System.Text.Encoding.Default.GetBytes("This is a test" + vbCrLf) myFtp.Upload(array, "test.txt", False)
Exceptions
Exception | Condition |
---|---|
Jscape.Ftp..::..FtpException | If an I/O or FTP error occurs. |