Revision [5244]

This is an old revision of RalphThesen made by RalphThesen on 2005-01-26 20:49:06.

 

RalphThesen


FilesAction with the correct MIME Header (based upon mimes.txt)

Replace line 16:
            Header("Content-Type: application/x-download");

with the following lines :
        // Examine Suffix
          if (preg_match("/.*\.(\w+)$/i",$filename,$res))
            $suffix=$res[1];
          // Search MIME Type
            if (!$suffix || $suffix=="" || !$this->config['mime_types']
               || !$mimes=implode("\n",file($this->config['mime_types'])))
               $content_type="application/x-download";
            else {
               if (preg_match("/([A-Za-z\/-]*).*$suffix/i",$mimes,$result))
                  $content_type=$result[1];
               else
                  $content_type="application/x-download";
            }
          Header("Content-Type: ".$content_type);
There are 5 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki