I can't seem to figure out the cause of this error when trying to validate a image upload
$imagevalidate = Validate::factory($_FILES);
$imagevalidate->rules($_FILES['profile_picture'], array(
'Upload::valid' => array(),
'Upload::not_empty' => array(),
'Upload::type' => array(
'Upload::type' => array(
'jpg',
'png',
'gif'
)
),
'Upload::size' => array(
'1M'
)
));
if ($imagevalidate->check()) {
$picture = Upload::save($_FILES['profile_picture']);
Image::factory($picture)->resize(200, 200, Image::WIDTH)->save();
$profile->profile_picture = basename($picture);
} else {
$errors = $imagevalidate()->errors('profile/edit');
}
I am getting this error ErrorException [ Warning ]: Illegal offset type in isset or empty