NET SFTP Library
SCPPutBinary(String,String) Method
Example 






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

Parameters

localFilePath
A fully qualified local file path
remoteFileName
Remote file name
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