Page 1 of 1

Limiting File Upload Size by Image Height/Width

Posted: Thu May 29, 2003 5:29 am
by Jim
Is it possible to limit an image upload by height/width?

Thanks!

Posted: Thu May 29, 2003 5:32 am
by Wayne
you will have to let the file upload then check the image properties using the GD library functions if you have that functionality on your server check out the entry for

GetImageSize()

then decide whether to save it or reject it.

Posted: Thu May 29, 2003 10:17 am
by liljester
it is totally possible. i have a script that checks image size, and resizes the image if its too big. however mine will only accept jpg and png files. check out the Image Functions on php.net. also you must have a GD library installed.