Uploads a local file 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(
	string localFile,
	string remoteFile
)
Visual Basic
Public Overridable Sub Upload ( _
	localFile As String, _
	remoteFile As String _
)
Visual C++
public:
virtual void Upload(
	String^ localFile, 
	String^ remoteFile
)

Parameters

localFile
Type: System..::..String
The local file (or directory) to upload.
remoteFile
Type: System..::..String
The destination filename (or directory) for the upload.

Remarks

If the local file is a directory then the directory and all the contents are uploaded relative to the remote directory.

Examples

The following example uploads the ico_test.gif file from the local directory to the relative \img\icon\ directory on the FTP server and renames the file to test_ico.gif.
CopyC#
myFtp.Upload("ico_test.gif", @"\img\icon\test_ico.gif");

Copy 
myFtp.Upload("ico_test.gif", "\img\icon\test_ico.gif")

Exceptions

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

See Also