I've created a form to upload images and the upload itself is working, but the wrong value gets written into the database.
This is the code in my controller:

```
<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Entity\Users;
use AppBundle\Service\FileUploader;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\FileType;

class DefaultController extends Controller
{
 /**
     * @Route("/bearbeiten/{id}", name="edit")
     */
     public function editAction($id, Request $request, FileUploader $fileUploader){
 $user = new Users();
        //Formular wird erstellt
        $form = $this->createFormBuilder($listen)
               ->add('bild', FileType::class, array('required'=>false, 'label'=>'Bild (JPEG-Datei)', 'data_class'=>null))
                ->add('save', SubmitType::class, array('label'=>'Speichern', 'attr'=>array('class'=>'btn btn-primary')))
                ->getForm();

        $form->handleRequest($request);
        //Falls die Form valid ist....
        if($form->isSubmitted() && $form->get('save')->isClicked()){

            //Daten aus der Form in Variabeln sichern
             $file = $form['bild']->getData();
             $filename = $fileUploader->upload($file);
             dump($filename);
             $user->setBild($filename);

             return $this->redirectToRoute('homepage');
         }
}
}

```

The service *FileUploader* is stored in *FileUploader.php* and has the following code:

```
<?php
namespace AppBundle\Service;

use Symfony\Component\HttpFoundation\File\UploadedFile;

class FileUploader
{
     private $targetDir;
     public function __construct($targetDir) {
         $this->targetDir = $targetDir;
     }
     public function upload(UploadedFile $file) {
         $fileName = md5(uniqid()).'.'.$file->guessExtension();
         $file->move($this->getTargetDir(), $fileName);
         return $fileName;
     }
     public function getTargetDir() {
         return $this->targetDir;
     }
}

```

I've also defined the service in *services.yml*:

```
  AppBundle\Service\FileUploader:
        arguments:
           $targetDir: '%file_directory%'

```

...and declared the variable *file\_directory* in config.yml:

```
parameters:
    locale: en
    file_directory: '/tmp'

```

Now when I dump the variabel **$filename**, I get the value back I expect, 2d504a8e0a9daba27e7baab69dc08896.jpeg as an example, but even though I use the same variabel to save the string into my database `$user->setBild($filename);`, another value gets written into my table. 
Example of the value in my db: */tmp/phpn7rb2i*

I'm really confused and appreciate any help.
Hopefully some of you can help me overcome this.