The Angular-file-upload directive by nervgh is an awesome lightweight AngularJS directive that handles file upload for you and lets you upload files asynchronously to the server. This article will provide you with a basic understanding of how to upload files using this directive together with the .NET WebAPI service on a SFTP server. For the purpose of this tutorial, I'll keep everything as simple as possible since the focus here is on connecting AngularJS and async upload with a .NET WebAPI service and not on additional functionality that can be built afterwards around the angular-file-upload.
From the Unix man page: "sftp is an interactive file transfer program, similar to ftp that does all operations over an encrypted ssh transport".Why is SFTP better than FTPIn FTP all data is passed back and forth between the client and server without the use of encryption. This makes it possible for an evesdropper to listen in and retrieve your confidential information including login details. With SFTP all the data is encrypted before it is sent across the network.
A brief description of how to use the article or code. The class names, the methods and properties, any tricks or tips.
HTML Code
1. extensionFilter is used to allow only PDF, Word and RTF documents.
2. The file size limit is also implemented by allowing file upto 5 MB.
3. Number of files allowed in upload queue is also implemented by filter.
4. In the WebAPI, an UploadedDocuments folder is created to get the file into the webserver from the client.5. Drag and drop is also implemented along with a default browse button.
For the complete source code, please see https://github.com/m-hassan-tariq/SFTPFileUploadUsingWebAPIandAngularJS