title: File upload does not work on cakePHP 2.x
body: <p>I am trying to upload the user pictures, but with the following example nothing is getting saved into the database and no errors are given. I know that the validation has to be done and it will once I get the files to be stored.</p>
  
  <p>Here are the snippets from the view file:</p>
  
  <pre><code>&lt;?php 
  echo $this-&gt;Form-&gt;create('User', array('enctype' =&gt; 'multipart/form-data'));
  echo $this-&gt;form-&gt;input('upload', array('type' =&gt; 'file')); 
  echo $this-&gt;Form-&gt;end('Submit');
  ?&gt;
  </code></pre>
  
  <p>The controller:</p>
  
  <pre><code>public function add() {
      if ($this-&gt;request-&gt;is('post')) {
          if(!empty($this-&gt;data['User']['upload']['name'])){
               $file = $this-&gt;data['User']['upload'];
               move_uploaded_file($file['tmp_name'], WWW_ROOT . 'img/uploads/users/' . $file['name']);
               $this-&gt;data['User']['image'] = $file['name'];
          }                   
          if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) {
              $this-&gt;Session-&gt;setFlash('The employee has been saved');
              $this-&gt;redirect(array('action' =&gt; 'index'));
          } else {
              $this-&gt;Session-&gt;setFlash('The employee could not be saved. Please, try again.');
          }
      }
  }
  </code></pre>