title: edit view without modifying file cakePHP
body: <p>View(edit) is displaying all the fields correctly and updating modified fields but it cant handle files. i.e.,  if  new file is uploaded then it has to be updated if not old file name has to be retained. </p>
  
  <p>controller:</p>
  
  <pre><code>public function edit($id = null) {
      if (!$id) {
          throw new NotFoundException(__('Invalid post'));
      }
  
      $post = $this-&gt;Student-&gt;findById($id);
      if (!$post) {
          throw new NotFoundException(__('Invalid post'));
      }
  
      if ($this-&gt;request-&gt;is('post') || $this-&gt;request-&gt;is('put')) {
          $this-&gt;Student-&gt;id = $id;
          if ($this-&gt;Student-&gt;save($this-&gt;request-&gt;data)) {
              $this-&gt;Session-&gt;setFlash(__('Your post has been updated.'));
              return $this-&gt;redirect(array('action' =&gt; 'index'));
          }
          $this-&gt;Session-&gt;setFlash(__('Unable to update your post.'));
      }
  
      if (!$this-&gt;request-&gt;data) {
          $this-&gt;request-&gt;data = $post;
      }
      }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;h1&gt;Edit student record&lt;/h1&gt;
  &lt;?php   
      echo $this-&gt;Form-&gt;create('Student',array('type'=&gt;'file'));
      echo $this-&gt;Form-&gt;input('first_name'); 
      echo $this-&gt;Form-&gt;input('current_address');
      echo 'resume'.$this-&gt;Form-&gt;file('resume');
      echo $this-&gt;Form-&gt;input ('comments');
      echo 'photo'.$this-&gt;Form-&gt;file('photo'); 
      echo $this-&gt;Form-&gt;input('id', array('type' =&gt; 'hidden'));
      //echo $this-&gt;Form-&gt;input('resume', array('type' =&gt; 'hidden'));
      //echo $this-&gt;Form-&gt;input('photo', array('type' =&gt; 'hidden'));
      echo $this-&gt;Form-&gt;end('Save Post');
  </code></pre>
  
  <p>Can someone suggest me how to handle the upload thing </p>