title: Possible to force Codeigniter controller to handle direct link to file?
body: <p>I have a feeling this isn't possible but thought I'd check anyway.</p>
  
  <p>I have a directory called invoices in the webroot and inside that are directories for each user by id (22, 65 etc.) and inside each of these are the user's invoices with a random string name such as xy38yrv4629mg7.pdf.</p>
  
  <p>What I'd like to do is have a controller called invoice pick up requests for
  <a href="https://www.domain.tld/invoice/22/xy38yrv4629mg7.pdf" rel="nofollow">https://www.domain.tld/invoice/22/xy38yrv4629mg7.pdf</a> so I can run a security check to ensure that user is allowed to download that file and then have CI give them the file for download. Is this possible or is it outside of CI's control?</p>
  
  <p>I have a feeling the web server identifies the request as a file before CI even has a chance to initiate though. I can move the invoice directory out of the webfoot and do it that way but thought I'd definitively rule out this method first.</p>