Uploads a local file to the FTP server remote directory.
Namespace: Jscape.FtpAssembly: Jscape.Ftp (in Jscape.Ftp.dll) Version: 2.4.5.0
Syntax
C# |
---|
public virtual string UploadUnique( FileInfo localFile, string prefix ) |
Visual Basic |
---|
Public Overridable Function UploadUnique ( _ localFile As FileInfo, _ prefix As String _ ) As String |
Visual C++ |
---|
public: virtual String^ UploadUnique( FileInfo^ localFile, String^ prefix ) |
Parameters
- localFile
- Type: System.IO..::..FileInfo
The local file (or directory) to upload.
- prefix
- Type: System..::..String
The prefix for the remote filename
Return Value
Return the remote filename.
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 remote directory on the FTP server with the following
name:"test.gif" or if the name exists "test1.gif".
CopyC#
Copy

myFtp.UploadUnique("ico_test.gif","test.gif");

myFtp.UploadUnique("ico_test.gif","test.gif")
Exceptions
Exception | Condition |
---|---|
Jscape.Ftp..::..FtpException | If an I/O or FTP error occurs. |