Showing posts from 2017

How to create a .NET Core MVC File Uploader Module - Part 1

Fine UploaderEver since I started developing websites, file/image uploading really gave me a hard time because I just couldn't figure out how to make the upload more generic and pluggable. After seeing Google/Facebook/500px♥ does it, I figured, it must be possible and should be simple. I always tend to over-complicate stuff. A prime example is this SO question (Adjusting dates in an array based on a start date) I asked a few days back. After a few tries, I came up with a solution. This is done using .NET Core MVC6 and You are free to steal this and modify according to your needs. (Give credits where necessary, be human)

So my requirements are simple:
To be able to upload files into a central file repositoryTo be able to select uploaded files and attach them to a postIf it's an image, show a previewTo be able to add metadata related to the file as we upload themTo be able to validate the said metadata before uploadingTo be able to plug it into any page without too much configura…