Modified File-Action

When you attempt to open or download a Microsoft Office document (.doc file, .xls file, .ppt file, and so on) from a secure Web site in Internet Explorer, you may receive one of the following error messages, even though the document is available and downloaded from the server:
Internet Explorer cannot download file from server.

Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
The page cannot be displayed.

The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

Cannot find server or DNS Error
Office Application Name cannot open the file.

The problem occurs if the server is using Secure Sockets Layer (SSL) and has added one or both of the following HTTP headers to the response message:
Pragma: no-cache Cache-control: no-cache,max-age=0,must-revalidate

// upload path
if ($this->config['upload_path'] == '')
    $this->config['upload_path'] = 'files';
$upload_path = $this->config['upload_path'].'/'.$this->GetPageTag();
if (! is_dir($upload_path))
// do the action
switch ($_REQUEST['action']) {
    case 'download':
            $_REQUEST['file'] = basename(urldecode($_REQUEST['file']));
            if ($this->HasAccess('read')) {
                $path = "{$upload_path}/{$_REQUEST['file']}";
                $filename = basename($path);
                // Examine Suffix
               if (preg_match("/.*\.(\w+)$/i",$filename,$res))
               // Search MIME Type
                 if (!$suffix || $suffix=="" || !$this->config['mime_types']
                    || !$mimes=implode("\n",file($this->config['mime_types'])))
                 else {
                    if (preg_match("/([A-Za-z.\/-]*).*$suffix/i",$mimes,$result))
                    header("Pragma: public");
                    header("Expires: 0");
                    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                    header("Cache-Control: public");
                    header("Content-Description: File Transfer");

                    Header("Content-Type: ".$content_type);

                    //Force the download
                    Header("Content-Disposition: attachment; filename=".$filename);
                    header("Content-Transfer-Encoding: binary");
                    Header("Content-Length: ".filesize($path));
                    // Header("Connection: close");
    case 'delete':
             if ($this->HasAccess('write')) {
            //  if ($this->IsAdmin()) {
            print $this->redirect($this->Href());

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki