title: cakePHP optional validation for file upload
body: <p>How to make file uploading as optional with validation?
  The code below validates even if i didn't selected any file.
  I want to check the extension only if i selected the the file.
  If i am not selecting any file it should not return any validation error.</p>
  
  <pre><code>class Catalog extends AppModel{
      var $name = 'Catalog';
      var $validate = array(
          'name' =&gt; array(
              'rule' =&gt; '/^[a-z0-9 ]{0,}$/i',
              'allowEmpty' =&gt; false,
              'message' =&gt; 'Invalid Catalog name'
          ),
          'imageupload' =&gt; array(
              'rule' =&gt; array('extension',array('jpeg','jpg','png','gif')),
              'required' =&gt; false,
              'allowEmpty' =&gt; true,
              'message' =&gt; 'Invalid file'
          ),
         );
  }
  </code></pre>
  
  <p>thanks in advance</p>