title: How to get the absolute path of a file in Symfony2?
body: <p>I am using Symfony2 framework and I placed 2 pdf files in the doc folder (beside app and web folders)</p>
  
  <p>In my controller I wrote this :</p>
  
  <pre><code>$path = $this-&gt;get('kernel')-&gt;getRootDir() . "/../doc/" . $filename . '.pdf';
  </code></pre>
  
  <p>I debug the project and I have inside the variable $path:</p>
  
  <pre><code>c:/wamp/www/myproject/app/../doc/myfile.pdf
  </code></pre>
  
  <p>Taking this path and putting it in the windows system explorer I can open the file. (so it seems to be good)</p>
  
  <p>But inside the controller whatever function I called on $path returns null, for example mime_content_type() or basename() and if I write file_get_content($path), it says that the file does not exist.</p>
  
  <p>Any idea ?</p>