Also this ain't working for validation of file input:

Model file, using cake 1.2:

        var $validate = array(
                                        'file' => array(
                                        'required' => VALID_NOT_EMPTY,
                                        'size' => array('rule' => 'size', 
'message' => 'File size
must be lower than 500kb.'),
                                        'image' => array('rule'=>'image', 
'message' => 'File must be
an image: gif, bmp, jpg, png.')
                                ));


     function image($check) {
                 if (
                           $check['type'] == 'image/bmp'
                        or $check['type'] == 'image/x-windows-bmp'
                        or $check['type'] == 'image/gif'
                        or $check['type'] == 'image/jpeg'
                        or $check['type'] == 'image/pjpeg'
                        or $check['type'] == 'image/png'
                        ){
                        return true;
                }
                return false;
        }

        function size($check, $max=524288) {
                if ($check['size'] <= 524288) {
                        return true;
                }
                return false;
        }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to