Hello, I have the following problem:

I have completed a form for uploading an image, and in the controller
i can check its size as follows:

...
if ( $this->params["form"]["userfile"]["size"] > 102400 ) {
  $result = False;
  $error_message="La dimensione massima dell' immagine deve essere
100K";
}
...

But I cannot make it work with the model-validator I am using. In the
model I have
the following checks but the function check_photo_size is never called.
I need this way to check the image size so i can display the message in
the form so the user does not have to reinput the data from scratch.

----

var $validate = array
        'name' => array(array(VALID_NOT_EMPTY, 'Inserisci il tuo nome.')),
        'lastname' => array(array(VALID_NOT_EMPTY, 'Inserisci il tuo
cognome.')),
        'phonenumber' => array(array(VALID_NOT_EMPTY, 'Inserisci un numero di
telefono.')),
        'userfile' => array(array('check_photo_size', 'La dimensione della
foto non puo\' superare i 100 KB.'))
);

        
function check_photo_size()
{
        pr ("hello"); 
}
---

Thanks,

Michele


--~--~---------~--~----~------------~-------~--~----~
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