title: Best practice to upload files in CakePHP
body: <p>Can any one suggest me the best way to write code for uploading a file in CakePHP?</p>
  
  <ul>
  <li>I need to upload a file and save its name in table.</li>
  <li>If the record saving fails it should not upload the file.</li>
  <li>If the uploading fails then the record should be rollbacked.</li>
  <li>The code should be reusable</li>
  <li>I need to upload the file in <code>afterSave</code> callback</li>
  </ul>