title: symfony2 - file upload lost upon form error
body: <p>I have followed tutorial: <a href="http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html" rel="nofollow">http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html</a></p>
  
  <p>but I have problem handling situation when I upload file, but other field does not meet validation criteria and user is directed to fix form errors. Then when user fix problem and hit submit button, he no longer has valid image in form and missing file error is displayed.</p>
  
  <p>I have prepared small example project to illustrate this behavior: </p>
  
  <p><a href="https://github.com/Jaslanin/sf_upload_form_error" rel="nofollow">https://github.com/Jaslanin/sf_upload_form_error</a></p>
  
  <p>Steps to reproduce this behavior:</p>
  
  <ol>
  <li>open web/ dir of project inside browser</li>
  <li>in name field put string "123"</li>
  <li>set image file for file field</li>
  <li>hit submit button</li>
  <li>change name field to "123456"</li>
  <li>hit submit button</li>
  <li>observe that form has missing file error</li>
  </ol>
  
  <p>For now I handled this problem using steps within "How to Handle File Uploads with Doctrine" tutorial, but without using lifecyclecallbacks. I run ->upload manually and in case of error store file path inside session. </p>
  
  <p>It works, but I am looking for cleaner solution for that problem.</p>