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.
So, obviously, the first issue that appeared is what kind of header must I set. First of all, Content-Disposition
is set as "attachment", so this is good, but I can't seem to get around Content-Type
. 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 switch
. What are my options?
Thanks!