title: Symfony - The file could not be found
body: <p>Entity have nullable=true. Form have required = false. HTML generated havent any required.</p>
  
  <p>When I leave file input I got error:</p>
  
  <blockquote>
    <p>The file could not be found.</p>
  </blockquote>
  
  <p>to be honest I have no idea where should I looking for... ;)</p>
  
  <pre><code>public function updateAction(Request $request, $id)
  {
  
      $em = $this-&gt;getDoctrine()-&gt;getManager();
  
      $entity = $em-&gt;getRepository('FortiCoreBundle:Article')-&gt;find($id);
  
      if (!$entity) {
          throw $this-&gt;createNotFoundException('Unable to find Article entity.');
      }
  
      $deleteForm = $this-&gt;createDeleteForm($id);
      $editForm = $this-&gt;createEditForm($entity);
      $editForm-&gt;handleRequest($request);
      // $editForm-&gt;isVail() false because have error The file could not be found.
      if ($editForm-&gt;isValid()) {
  </code></pre>
  
  <p>Entity file:</p>
  
  <pre><code>/**
   * @var string
   *
   * @ORM\Column(name="path", type="string", length=255, nullable=true)
   * @Gedmo\UploadableFilePath
   */
  private $path;
  
  /**
   * @var string
   *
   * @Assert\File(
   *     maxSize="3M",
   *     mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
   * )
   *
   * @ORM\Column(name="filename", type="string", nullable=true)
   * @Gedmo\UploadableFileName
   */
  private $filename;
  
  public function uploadPath()
  {
      return 'images/article/' . date('Y') . '/' . date('m');
  }
  
  public function getRelativePath()
  {
      if (empty($this-&gt;filename)) {
          return null;
      } else {
          return $this-&gt;uploadPath() . '/' . $this-&gt;filename;
      }
  }
  
  /**
   * Set filename
   *
   * @param string $filename
   * @return Article
   */
  public function setFilename($filename)
  {
      if (!is_null($filename)) {
          $this-&gt;filename = $filename;
      }
  
      return $this;
  }
  
  /**
   * Get filename
   *
   * @return string
   */
  public function getFilename()
  {
      return $this-&gt;filename;
  }
  </code></pre>
  
  <p>and FormType file:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          //...
          -&gt;add('filename', 'file', array(
              'label' =&gt; 'Zdjęcie',
              'required' =&gt; false,
              'data_class' =&gt; null,
              'attr' =&gt; array(
                  "class" =&gt; 'no-border btn-xs')
          ))
          //...
      ;
  }
  
  public function setDefaultOptions(OptionsResolverInterface $resolver)
  {
      $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'Forti\CoreBundle\Entity\Article'
      ));
  }
  
  public function getName()
  {
      return 'forti_corebundle_articletype';
  }
  </code></pre>