Skip to main content

Posts

Showing posts from November, 2015

File upload mechanism to support Local server, File Server and Azure server

Making direct dependency with Azure sounds as a big problem if there is a possibility of switching to other platforms in future. Also, in general, making dependencies with Azure also makes mandatory to run the application through Azure Emulator which itself takes the time to load application whenever need to be debugged. It takes huge amount of development time also based on architecture point it is not a good idea to have any hard dependency in application.

In this article, we will look into creating a mechanism for file upload which could be switched from Azure to local server or vice-versa.

The two key parts that are needed are to access the uploaded file and to upload the file. The starting stage is to create interfaces to access file path and upload files to server. This would allow us to change the implementation based on need.

Interfaces

IFileUpload : Interface for uploading files

using MyProject.Model.DTO.Upload; using MyProject.Model.Enumeration; using System; using S…