title: Symfony2 file upload get original file name
body: <p>I am unable to retrieve the originalName during a file upload.</p>
  
  <p>print_r($request->file) returns the following:</p>
  
  <pre><code>Symfony\Component\HttpFoundation\FileBag Object
  (
      [parameters:protected] =&gt; Array
          (
              [form_name] =&gt; Array
                  (
                      [backgroundImageFile] =&gt; Symfony\Component\HttpFoundation\File\UploadedFile Object
                          (
                              [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 
                              [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; bg_image.jpg
                              [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; image/jpeg
                              [size:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 65045
                              [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 0
                              [pathName:SplFileInfo:private] =&gt; /tmp/phpsU3X7a
                              [fileName:SplFileInfo:private] =&gt; phpsU3X7a
                          )
  
                  )
  
          )
  
  )
  
  
  echo "&lt;br /&gt; Name= ".$this-&gt;getRequest()-&gt;files['backgroundImageFile']-&gt;getClientOriginalName();
  </code></pre>
  
  <p>Returns:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function getClientOriginalName() on a
    non-object in ../path to the controller</p>
  </blockquote>
  
  <p>So, how do I get the OriginalName?</p>