0 votes
by (120 points)

I am evaluating REBEX SFTP and I am running your SftpBrowserWeb_VB sample, when I am selecting an small file (under 100 mb) the upload is working fine, when I am selecting a file bigger than 500 MB I am getting a message:

The Connection was reset

any advise will be appreciated.


Applies to: Rebex SFTP

1 Answer

0 votes
by (70.2k points)

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 support@rebex.net for analysis. It can be created like this:

_sftp.LogWriter = new Rebex.FileLogWriter("c:/data/sftp.log", LogLevel.Debug);
by (120 points)
Lukas, I am sorry for the delay,
correct me if I am wrong.
first I have to upload it to my webserver then from the websser upload to the SFTP server?
I have to implement this:
Upload DVDs from the Attorneys (most of them are evidence videos) to the court, using a web page, those files are 5 GB average, the company already purchase REBEX components, now I have to implement this. any advice is highly appreciate it.
Thanks a lot.
by (70.2k points)
You are absolutely correct. The file has to be uploaded by Web browser to Web server. Then it has to be uploaded by Web server to SFTP server.

The situation of uploading big files is nicely described at https://documentation.devexpress.com/AspNet/9886/ASP-NET-WebForms-Controls/File-Management/File-Upload/Concepts/Upload-Modes
See difference between Standard and Advanced upload modes.

You can use mentioned DevExpress ASPxUploadControl to handle file uploads to Web server. However, it stores the uploaded file into temp folder (on Web server). Better solution would be to upload incoming file "packets" to the SFTP server immediately, without storing them to a temp folder. You can ask DevExpress whether this is possible using some of their ASP components. Or try to find another vendor, which can offer this.

Another solution would be to workaround the problem of HTTP file upload by switching to Web sockets. Sample solution can be found at https://github.com/lukaaash/sftp-ws
However, this solution requires even more knowledge than simple use of advanced HTTP FileUpload control.