Just found out that my hint was wrong...

use

        /**
         * Checks if given data is valid
         */
        private function isHtmlFormFileData($data)
        {
                if(!is_array($data)) {
                        return false;
                }

                if(!array_key_exists('name',$data)
                || !array_key_exists('type',$data)
                || !array_key_exists('tmp_name',$data)
                || !array_key_exists('error',$data)
                || !array_key_exists('size',$data)) {
                        return false;
                }

                return true;
        }

On 13 Jan., 18:06, davidpersson <[EMAIL PROTECTED]> wrote:
> I implemented such a validation method in one of the classes I'm using
> for my project:
>
> See 
> Source:https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/vendors/transf...
>
> Scroll down to:
>         /**
>          * Checks if given data is valid
>          */
>         private function isHttpPostData($data)
>
> On 11 Jan., 12:02, Marcin Domanski aka kabturek <[EMAIL PROTECTED]>
> wrote:
>
> > Hey> Did, i miss something here? I am using 1.2.x (latest beta)
>
> > Yep ;)
> > did you see the actual Remarks field after posting data? try
> > debug($this->data);die(); if you dont have a debugger.
> > Cake is right by telling you its not empty cause it contains an array
> > of $_FILE['field'] so it is ALWAYS not empty.
> > Use customvalidationto check if ['Remarks']['tmp_name'] is not
> > empty, ['error;[ == 0 , and ['size'] != 0 etc
>
> > HTH,
> > Marcin Domanski aka kabturekhttp://tumble.kabturek.info/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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