title: Opening files in a server with codeigniter/php
body: <p><strong>What I want to do:</strong> Have the user click a link, it goes to a function also with a GET for file ext and file id(id is what it is named on the server). That function then opens that file in a new tab or downloads it if it cant be opened. </p>
  
  <p><strong>What I've Tried:</strong> Codeigniters read_file() function. 
       Also:</p>
  
  <pre><code> header('Content-type: application/pdf');
  
   header('Content-Disposition: attachment; filename="1.pdf"');
  
   readfile('1.pdf');
  </code></pre>
  
  <p>but that doesn't work. Or it does and i dont know how to configure it properly.</p>
  
  <p><strong>Where the files are:</strong> There is a folder named uploads. The uploads and the application folder for codeigniter are on the same level.</p>
  
  <p>I'm using codeigniter. The files are either, gif, jpg, or pdf. Thanks</p>