Integrating File Upload for ASP.NET with PowerTCP FTP or SFTP

Problem:

The developer is faced with the challenge of creating a web-based application that allows end-users to upload files to a remote FTP/S or SFTP (SSH FTP) server. The application must:

  • Allow a file to be uploaded using a web browser (Internet Explorer, Mozilla/Firefox, Safari)
  • Provide real-time progress feedback to the end-user
  • Not store files on the web server
  • Transmit files directly to a remote FTP or SFTP server

 

Solution:

By combining PowerWEB File Upload for ASP.NET with PowerTCP FTP for .NET or PowerTCP SSH and SFTP for .NET, using the ability to stream file data from point to point, applications can easily:

  • Begin streaming file data to the destination FTP/SFTP server as soon as the first buffer is received by the web server
  • Provide real-time progress information to the end-user regarding the entire operation from end to end
  • Create a secure method of file transfer, storing valuable assets behind corporate firewalls, while seamlessly exposing rich functionality to the outside world

 

The Sample Applications:

To download the full trial installations with additional product-specific samples and documentation, see the following:

PowerWEB File Upload for ASP.NET
PowerTCP FTP for .NET
PowerTCP SSH and SFTP for .NET

 

This ASP.NET application demonstrates how Dart's components can be combined to quickly create advanced functionality. While the interface of this application allows the end-user to configure the FTP/SFTP server and login credentials, these items can also be hard-coded into the application or placed in configuration files, thereby abstracting FTP functionality and increasing the overall security of the system. 


After running the sample, users simply select a file to upload, fill in server details and click "Upload File". As the file is uploaded, a connection is opened to the FTP/SFTP server and data is written to an open stream. This occurs immediately, and PowerWEB File Upload does not wait for the entire file before raising events in code-behind and passing along file data. Within the FileUpload.UploadManager.UploadProgress event, blocks of data are written to the open FTP or SFTP stream interface until the entire file has been uploaded. During the upload operation, the FileUpload.ProgressPanel displays a progress bar and transfer statistics in the open browser. This sample could also be extended to simultaneously stream files to multiple destinations of varying types such as SQL Databases and networked file servers.