I have a program that is uploading files to be processed by a service. The service watches the target folder and process each file it finds and then moves the file with a unique timestamp to an archive folder.
What I see when my program sends its file is the server grabs the file right away, BEFORE bytes have been sent, then grabs the file a second time AFTER bytes have been sent.
It would appear that SFtpConnection is creating and sending the file in two steps. Or, perhaps I am using the library incorrectly. 🙂 Does anyone see a problem with how I am using the library?
var host= “…”;
var port= “…”;
var sshKeyFile= “…”;
var stream= new System.IO.MemoryStream(System.IO.File.ReadAllBytes(sshKeyFile));
var sshKey= new PuTTYPrivateKeyFile(stream);
var file= “…”;
var targetFolder= “…”;
var sshClient = new SSHClient();
using (SFtpConnection sftp = new SFtpConnection(sshClient))
var filename= System.IO.Path.GetFileName(file);
var localFolder= new DiskFolder(System.IO.Path.GetDirectoryName(file));
var sourceFile= localFolder.GetFile(filename);
var remoteFolder= new SFtpFolder(sftp, targetFolder);
Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Aaron (had 662 views)