Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation #40

Open
dogmatic69 opened this issue Apr 21, 2010 · 3 comments
Open

validation #40

dogmatic69 opened this issue Apr 21, 2010 · 3 comments

Comments

@dogmatic69
Copy link

doing it according to the docs i can find it does not work

                'Empty' => array(
                    'check' => false
                )

is there another way or is it broken?

im doing this in the mean time

    function beforeFilter(){
        parent::beforeFilter();

        if(isset($this->data['Image'][0]['image']['name']) && empty($this->data['Image'][0]['image']['name'])){
            unset($this->data['Image']);
        }
    }
@jrbasso
Copy link
Owner

jrbasso commented May 2, 2010

You tried with master or 3.0 version?

@dogmatic69
Copy link
Author

does not seem like it, will upgrade and check think im on 2.1

@mtnorthrop
Copy link

I had trouble getting this working in MeioUpload 2.2 (CakePHP 1.2) also, but mainly due to a lack of documentation.

To disable a validation rule on my file upload field, I had to set the validation rule in the model that the field belonged to. I was trying to set the validation in the MeioUpload behavior settings, which is why it wasn't working.

For a file upload form field like this:
echo $form->input('News.image', array('type' => 'file'));

I had to put this in my News model:
var $validate = array('image' => array( 'Empty' => array('check' => false)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants