I have been using Codgniter and grocerycrude for some time but i have stumble on one thing that i cant clearly understand why it shouldn't work
My problem is, i want to upload pdf file only and the size must not exceed 5MB specifically for a particular function. And i dont want to set this configuration in the grocerycrude config file, but rather in a callback fuction (call_back_before_upload) something like this
function valid_magazine($files_to_upload, $field_info){if ($files_to_upload[$field_info->encrypted_field_name]['type'] !='magazines/pdf'){return 'Sorry, you can only upload pdf file.';}elseif($files_to_upload[$field_info->encrypted_field_name]['size'] > '5MB'){return 'Sorry, the file size must be under 5MB';}else{return true;}