Safe and “quadratic” photo upload in ASP.NET MVC

I am creating a website for the club and I want every member to be able to upload a profile photo.

I saw several questions and answers on SO on how to do this, but I am concerned about two things that are a bit more complicated:

  • Security . I want people to not upload files that are not valid images and / or contain malicious content.

  • Homogeneity . I want the files to be reasonably sized and the images to be square. I would like to provide a user interface to help the user crop a photo into a square as soon as the photo is uploaded and confirmed.

Ideally, I would like to find a free open source utility that I can just plug into my application and leave. If there was nothing like this, I would appreciate advice and / or sample code.

+5
source share
1 answer

I don’t think there is any plug-in utility that will help you. It would be best to just create something yourself. Here are two blog articles to help you easily create your own validator:

+4

All Articles