CodeIgniter Forums
Server side Validation for image upload - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Server side Validation for image upload (/showthread.php?tid=4426)



Server side Validation for image upload - El Forum - 11-24-2007

[eluser]MASS MASS[/eluser]
I am using upload library to upload image........

$config['allowed_types'] = 'gif|png|jpg';
$config['max_size'] = '10000';
$config['max_width'] = '200';
$config['max_heigth'] = '200';
$config['upload_path'] = './uploads/'
$this->load->library('upload', $config);


while user uploading image........user should upload minimum widht and minimum height

for this how to do.........

CI have only max_width and max_heigth.........


Server side Validation for image upload - El Forum - 08-21-2008

[eluser]Unknown[/eluser]
I am having the same issue.
Is there an easy way to check minimum width/height of uploaded images ?


Server side Validation for image upload - El Forum - 08-21-2008

[eluser]drewbee[/eluser]
The PHP function getimagesize();
It will return an array of several attributes of the image, including the height and width.

http://us3.php.net/manual/en/function.getimagesize.php