NET SFTP Library
SCPPutBinary(String,String,IFireProgress) Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class > SCPPutBinary Method : SCPPutBinary(String,String,IFireProgress) Method
A fully qualified local file path
Remote file name
Monitor the progress
Upload a file using SCP
Syntax
'Declaration
 
Public Overloads Sub SCPPutBinary( _
   ByVal localFilePath As System.String, _
   ByVal remoteFileName As System.String, _
   ByVal fireProgress As IFireProgress _
) 
'Usage
 
Dim instance As SFTP
Dim localFilePath As System.String
Dim remoteFileName As System.String
Dim fireProgress As IFireProgress
 
instance.SCPPutBinary(localFilePath, remoteFileName, fireProgress)
public void SCPPutBinary( 
   System.string localFilePath,
   System.string remoteFileName,
   IFireProgress fireProgress
)
public procedure SCPPutBinary( 
    localFilePath: System.String;
    remoteFileName: System.String;
    fireProgress: IFireProgress
); 
public function SCPPutBinary( 
   localFilePath : System.String,
   remoteFileName : System.String,
   fireProgress : IFireProgress
);
public: void SCPPutBinary( 
   System.string* localFilePath,
   System.string* remoteFileName,
   IFireProgress* fireProgress
) 
public:
void SCPPutBinary( 
   System.String^ localFilePath,
   System.String^ remoteFileName,
   IFireProgress^ fireProgress
) 

Parameters

localFilePath
A fully qualified local file path
remoteFileName
Remote file name
fireProgress
Monitor the progress
Remarks
https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
Example
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
sftp.UserName  = "anonymus"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
sftp.SCPPutBinary("C://Download/a.txt", "a.txt");
 
System.Console.WriteLine("a.txt {0}", sftp.FileExists("a.txt") == true ? "is on the ftp server" : "does not exist on the ftp server");
Dim sftp As New SFTP() 'Trial Mode
'Dim sftp = New SFTP("place user name here", "place license key here")
 
' set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com" ' replace with your SFTP server
sftp.UserName = "anonymus" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
sftp.SCPPutBinary("C://Download/a.txt", "a.txt")
 
System.Console.WriteLine("a.txt {0}",If(sftp.FileExists("a.txt") = True, "is on the ftp server", "does not exist on the ftp server"))
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members
Overload List