title: PHP file download header
body: <p>I have developed a small download system in PHP, where files are downloaded through a proxy file. When I had to do this before, I just redirected by changing the location header; which is not what I want to do now.</p>
  
  <p>So, obviously, the first issue that appeared is what kind of header must I set. First of all, <code>Content-Disposition</code> is set as "attachment", so this is good, but I can't seem to get around <code>Content-Type</code>. I need to set it to fit all possible files that might be downloaded through this system. I don't know how to detect the file header automatically, and I'm trying to aviod a GIANT <code>switch</code>. <strong>What are my options?</strong></p>
  
  <p>Thanks!</p>