Hello,
I'm currently evaluating the SFTP software and am loving what I've seen so far. However, I'm unable to get UploadAsync (or DownloadAsync for that matter) to work properly. Passing a single memorystream to PutFileAsync works as expected.
Here's the code:
public async Task<Task> TransferDirectoryAsync(string localDirectory, string remoteDirectory)
{
bool remoteDirectoryExists = DirectoryExists(remoteDirectory);
if (!remoteDirectoryExists)
{
remoteDirectoryExists = CreateDirectory(remoteDirectory);
}
Task uploadTask = null;
try
{
uploadTask = _sftp.UploadAsync(localDirectory, remoteDirectory, TraversalMode.MatchFilesShallow,
TransferMethod.Copy, ActionOnExistingFiles.OverwriteAll);
await uploadTask;
}
catch (Exception ex)
{
logger.Write("Exception thrown while transferring file: " + ex.Message);
}
return uploadTask;
}
I have a TransferProgressChanged handler attached and, immediately upon making the call, that fires with a TransferProgressState.TransferCompleted event. Again, I have the exact same logic for PutFileAsync, and it works as expected. Any help would be greatly appreciated. Thanks.