ComponentSpace FTP Class Library Reference

FtpClient.Upload Method 

Upload the local file's contents to the remote file. If destinationPathName is null then a unique name is generated on the remote server.

[Visual Basic]
Public Shared Sub Upload( _
   ByVal serverAddress As String, _
   ByVal userName As String, _
   ByVal password As String, _
   ByVal transferMode As TransferMode, _
   ByVal sourcePathName As String, _
   ByVal destinationPathName As String _
)
[C#]
public static void Upload(
   string serverAddress,
   string userName,
   string password,
   TransferMode transferMode,
   string sourcePathName,
   string destinationPathName
);

Parameters

serverAddress
The server address (eg. 207.46.133.140 or ftp.microsoft.com).
userName
The FTP user name eg. anonymous.
password
The FTP password eg. your email address.
transferMode
The transfer mode - ASCII or binary.
sourcePathName
The local file name.
destinationPathName
The remote file name or null.

Exceptions

Exception Type Condition
FtpException Thrown when the upload fails.

See Also

FtpClient Class | ComponentSpace.Ftp Namespace