I want to set minimum width and height for uploading images in codeigniter. The code is shown below.
$config['max_width'] = '480';
$config['max_height'] = '270';
$this->upload->do_upload()
I have set maximum cut off for this but how to set minimum ??
Copy your
Upload.php
fromsystem/libraries
and paste onapplication/libraries
. Then, introduce 2 new variables.Add these to the
initialize
function so that you can pass values through a$config
variable.Locate
is_allowed_dimensions
function and modify it.Check the upload language file and alter the
upload_invalid_dimensions
key accordingly to fit your case.Have not tested this, but should work :)
Here is the working fix, additionally you need to specify min_height and min_width while you init