title: PHP echo file contents
body: <p>I have a pdf file which is located off my webpage's root. I want to serve a file in <code>../cvs</code> to my users using php.</p>
  
  <p>Here is the code I have sofar:</p>
  
  <pre><code>header('Content-type: application/pdf');
  
  $file = file_get_contents('/home/eamorr/sites/eios.com/www/cvs/'.$cv);
  echo $file;
  </code></pre>
  
  <p>But when I call this php page, nothing gets printed! I'd like to simply serve the pdf file stored whose name is in <code>$cv</code> (e.g. <code>$cv = 'xyz.pdf'</code>).</p>
  
  <p>The ajax response to this PHP page returns the text of the pdf (gobbldy-gook!), but I want the file, not the gobbldy-gook!</p>
  
  <p>I hope this makes sense.</p>
  
  <p>Many thanks in advance,</p>
  
  <hr>
  
  <p>Here's the AJAX I'm using</p>
  
  <pre><code>$('#getCurrentCV').click(function(){
      var params={
          type: "POST",
          url: "./ajax/getCV.php",
          data: "",
          success: function(msg){
              //msg is gobbldy-gook!
          },
          error: function(){
  
          }
      };
      var result=$.ajax(params).responseText;
  });
  </code></pre>
  
  <p>I'd like the user to be prompted to download the file.</p>