I suppose that "The Connection was reset" error was generated by your web browser. It is not a .NET exception raised by the Rebex SFTP component.
If my assumption is correct, the error is caused by long activity on Web server (file is uploading to SFTP server for very long time) and the client (Web browser) did receive no response from Web server for very long time. After some period the Web browser give up to wait for Web server response and displayed "The Connection was reset".
This is know feature of the
SftpBrowserWeb sample. The primary purpose of the sample is showing the usage of
Rebex.Net.Sftp class. The sample has no purpose to implement advanced
FileUpload control, which is much more complicated task not related to usage of Rebex classes.
The suggested solution is to use an advanced
FileUpload control instead of standard
System.Web.UI.WebControls.FileUpload control. Such control should be able to provide uploaded data on the fly (on the side of Web server) and keep the Web browser notified about the progress for whole time. You can ask for recommendations for such control in a Web developer community e.g. on https://stackoverflow.com.
If the error was raised by the Rebex SFTP component, please create communication log and post it here or send it to firstname.lastname@example.org for analysis. It can be created like this:
_sftp.LogWriter = new Rebex.FileLogWriter("c:/data/sftp.log", LogLevel.Debug);