Possible bug in Session.PutFile
I have been using this client for some time. It's an awesome library.
I am doing a simple upload via streaming.
Usually, when I am uploading I use the physical path method as I have the file physically.
Currently, I am downloading the file from one location and uploading it to another location.
Using this method avoids creating unnecessary files locally.
I am getting an error on this line.
https://github.com/winscp/winscp/blob/5.18.2-beta/dotnet/Session.cs#L823
I am not familiar with the internals but I looking at code.
I think this check is incorrect.
Below is my code for calling this method.
https://winscp.net/eng/docs/library_session_putfile
I am doing a simple upload via streaming.
Usually, when I am uploading I use the physical path method as I have the file physically.
Currently, I am downloading the file from one location and uploading it to another location.
Using this method avoids creating unnecessary files locally.
I am getting an error on this line.
https://github.com/winscp/winscp/blob/5.18.2-beta/dotnet/Session.cs#L823
I am not familiar with the internals but I looking at code.
I think this check is incorrect.
this._process.StdIn
is going to be null in the beginning.
Below is my code for calling this method.
https://winscp.net/eng/docs/library_session_putfile
public void UploadFile(Stream stream, string remotePath) { // Setup session options var sessionOptions = new SessionOptions { Protocol = Protocol.Ftp, HostName = FtpHostName, UserName = FtpUser, Password = FtpPassword }; using Session session = new Session(); // Connect session.Open(sessionOptions); if (session.Opened) { session.PutFile(stream, remotePath); } }