eufpnw
Last Updated: February 25, 2016
·
781
· iondrimba
178548

Verify image dimensions on upload!

using System.Drawing;

Stream inputStream = httpContext.Request.Files[0].InputStream;
using(Image img = Image.FromStream(inputStream))
    {   
        if( img.Width < 640 && img.Height < 480)
        {
                throw new Exception("your error message");
        }
    }
Say Thanks
Respond