Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Closed Issue: On large files to unix environment sometimes 00's are put in place of real data [1262]

$
0
0
<p>I&#39;m using the following code to send a file to a Unix server:</p>
<p>&nbsp;</p>
<p> using (Renci.SshNet.SftpClient sftpObj = new Renci.SshNet.SftpClient(destination, destination_userid, destination_pwd))</p>
<p> {</p>
<p> sftpObj.BufferSize = ((1024 * 32 - 38) / 2); //&lt;-- I&#39;ve left this out, changed #&#39;s, etc...</p>
<p> sftpObj.ConnectionInfo.Timeout = TimeSpan.FromMinutes(2);</p>
<p> sftpObj.OperationTimeout = TimeSpan.FromMinutes(8);</p>
<p> sftpObj.Connect();</p>
<p> sftpObj.UploadFile(strminput, Path.Combine(destination_dir, destination_file));</p>
<p> //IAsyncResult asynch = sftpObj.BeginUploadFile(strminput, Path.Combine(destination_dir, destination_file), true, null, null);</p>
<p> //while (!asynch.IsCompleted)</p>
<p> // Thread.Sleep(1);</p>
<p> //sftpObj.EndUploadFile(asynch);</p>
<p> sftpObj.Disconnect();</p>
<p> sftpObj.Dispose();</p>
<p> }</p>
<p>&nbsp;</p>
<p>I&#39;m picking up a file from the same server the application is running on, putting it in a stream and sending it to the Unix server.</p>
<p>&nbsp;</p>
<p>Most of the time it works correctly, but every once in a while (even on the same file) it will start writing out the file correctly, but then a bunch of 00&#39;s instead of the real data and pick right back up correctly. As you can see, I&#39;ve tried sync and async methods. Same results.</p>
<p>&nbsp;</p>
<p>The files that are correct are the same exact size as the files that are not (18.5MB) when using the same source files.</p>
<p>&nbsp;</p>
<p>Please let me know if you need more info and thank you very much in advance for any help.</p>

Comments:

No response from the user


Viewing all articles
Browse latest Browse all 1026

Trending Articles