Hello,
i am trying to add fixed image validation in image crud class but not succeded in it. tryed below code but not worked. image not uploaded but database entry done. any help appreciated.
class ImageUploadHandler
{
========
private function has_error($uploaded_file, $file, $error) {
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
$file_size = filesize($uploaded_file);
list($width, $height, $type, $attr) = getimagesize($uploaded_file);
if($width != 600 || $height != 800){
return 'maxFileSize';
}
} else {
$file_size = $_SERVER['CONTENT_LENGTH'];
}
}