I've taken the part that tests the uploaded filesize from the shop version /includes/classes/upload.php modified it to suit and added it to the admin version /admin/includes/classes/upload.php. Here is what I've come up with at around line 72
Code:
if ( zen_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) ) {
/*** My added code to restrict product image filesize ***/
if (zen_not_null($file['size']) and ($file['size'] > MAX_FILE_UPLOAD_SIZE)) {
if ($this->message_location == 'direct') {
$messageStack->add(ERROR_FILE_TOO_BIG, 'error');
} else {
$messageStack->add_session(ERROR_FILE_TOO_BIG, 'error');
}
return false;
}
/*** End added code ***/
if (sizeof($this->extensions) > 0) {
if (!in_array(strtolower(substr($file['name'], strrpos($file['name'], '.')+1)), $this->extensions)) {
if ($this->message_location == 'direct') {
$messageStack->add(ERROR_FILETYPE_NOT_ALLOWED, 'error');
} else {
$messageStack->add_session(ERROR_FILETYPE_NOT_ALLOWED, 'error');
}
return false;
}
}
It seems to do exactly what I wanted but I would greatly appreciate some thoughts from those more experienced than me
I hope it may help others too