title: Symfony 3 VichUploaderBundle not moving images to the correct directory
body: <p>I am attempting to use The VichImageBundle with Symfony3, there is no documentation as of yet for the FormType::class call that is new to S3 in conjunction with the Vich Image Bundle. I have everything working except for the moving part.</p>
  
  <p>I have made a folder structure here inside the project here: web/images/aod_images</p>
  
  <p>I have set the configuration in the yml file like this:</p>
  
  <pre><code>vich_uploader:
      db_driver: orm 
  
      mappings:      
          aod_images:
              uri_prefix:         /images/aod_images
              upload_destination: %kernel.root_dir%/../web/images/aod_images
  </code></pre>
  
  <p>The entity properties are here: (I have the getters and setters in place)</p>
  
  <pre><code>/**
   * @Vich\UploadableField(mapping="aod_images", fileNameProperty="dailyChartName")
   * 
   * @var File
   */
  private $dailyChart;
  
  /**
   * @ORM\Column(type="string", length=255)
   * 
   * @var string
   */
  private $dailyChartName;
  
  /**
   * @Vich\UploadableField(mapping="aod_images", fileNameProperty="twohourChartName")
   * 
   * @var File
   */
  private $twohourChart;
  
  /**
   * @ORM\Column(type="string", length=255)
   * 
   * @var string
   */
  private $twohourChartName;
  </code></pre>
  
  <p>I am calling a set time method as appropriate in the controller class, specifically on the editAction and the newAction controllers:</p>
  
  <pre><code>$analysis-&gt;setUpdatedAt(new \DateTime('now'));
  </code></pre>
  
  <p>In the FormType class for this entity I have the following so far:</p>
  
  <pre><code>-&gt;add('dailyChartName', FileType::class, array())
  -&gt;add('twohourChartName', FileType::class, array())
  </code></pre>
  
  <p>I'm not sure what options to pass to the ->add method yet for each image instance.</p>
  
  <p>The application is building the forms correctly.</p>
  
  <p>When I do a tail -f the dev.log I get the following message as part of the doctrine.DEBUG channel:</p>
  
  <pre><code>(Symfony\\Component\\HttpFoundation\\File\\UploadedFile: /Applications/MAMP/tmp/php/phpEz6kJO)","13":"[object] (Symfony\\Component\\HttpFoundation\\File\\UploadedFile: /Applications/MAMP/tmp/php/phpVkbZgi)
  </code></pre>
  
  <p>The image name property does not match what I have mapped in the config.yml file. Instead the path reflects my local machines route to internal php tmp directory. I'm running this from 127.0.0.1:8000 after using the server:run command.</p>
  
  <p>When I look in that directory the image has <strong>NOT</strong> been moved there.</p>
  
  <p>The (incorrect)image name is being copied to the database. However the path to the image is empty (incorrect path). In addition the correct path/directory is also empty.</p>
  
  <p>Regards!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As per suggestion by Matteo I have made the following change to the FormType.php file.</p>
  
  <pre><code>-&gt;add('dailyChart', VichFileType::class, array(
              'required' =&gt; TRUE,
          ))
  -&gt;add('twohourChart', VichFileType::class, array(
              'required' =&gt; TRUE,            
          ))
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>In an attempt to make my implementation to adhere more closely to the documentation I put my updatedAt set inside the entity as per docs suggestion.</p>
  
  <p>My set methods look something like this:</p>
  
  <pre><code>public function setDailyChart(\Symfony\Component\HttpFoundation\File\UploadedFile $dailyChart)
  {
      $this-&gt;dailyChart = $dailyChart;
          if ($dailyChart) {
              $this-&gt;updatedAt = new \DateTime('now');
          }
      return $this;
  }
  </code></pre>
  
  <p>I explicitly set typehinting with a full path. Now I receive the following error.</p>
  
  <pre><code>AppBundle\Entity\MTI_Cart\AodTechnicalAnalysis::setDailyChart() must be an instance of Symfony\Component\HttpFoundation\File\UploadedFile, instance of Symfony\Component\HttpFoundation\File\File given
  </code></pre>