Welcome to AspAdvice Sign in | Join | Help

CodeSnip: Validate Image Size, Dimension, and Type Uploads

Do you allow your users to upload images? If so would you like to place some restrictions on the size, dimensions, and type of image that is acceptable? Accomplishing this is much easier than you may think.

Let us say we have the following business rules that we need to enforce.

1.      Image must be either a GIF or JPG.

2.      Image can be no larger than 512KB.

3.      Image dimensions can be no greater than 600x600.

By enforcing such rules you can then prevent those rouge users who may want to eat up your file system space. [Code Snippet Soon will be available at ASPAlliance ]

Sponsor
Published Sunday, February 12, 2006 3:44 PM by sswafford
Filed under: ,

Comments

No Comments

New Comments to this post are disabled