PHP file download header
        Posted  
        
            by skidding
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by skidding
        
        
        
        Published on 2010-03-17T20:45:17Z
        Indexed on 
            2010/03/17
            20:51 UTC
        
        
        Read the original article
        Hit count: 808
        
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!
© Stack Overflow or respective owner