Categories > OpenTBS general >

openTBS download headers IE problem

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: puttext
Date: 2012-04-12
Time: 10:29

openTBS download headers IE problem

When i make an OpenDocument file for download over https site, IE doesn't download the file. This seems to be an IE bug with cahce header over https.
The solution is to use this php code to reset cahe and pragma headers:
header("Pragma: ");
header("Cache-Control: ");

I don't known much of cache and pragma headers to say that this workaround it's correct also for other browser. But with this modify at source code of tbs_plugin_opentbs.php (from line 3119 of version 1.7.5) the download works corectly with all browsers on https site:
                $user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
                if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) {
                    header("Pragma: ");
                    header("Cache-control: ");
                    header('Content-Disposition: filename="'.$File.'"');
                } else {
                    header('Expires: 0');
                    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                    header('Cache-Control: public');
                    header("Pragma: no-cache");                                    // HTTP/1.0
                    header("Cache-control: private");                          // <= it's magical!!
                    header('Content-Disposition: attachment; filename="'.$File.'"');
                }
                //header ('Pragma: no-cache');
                if ($ContentType!='') header ('Content-Type: '.$ContentType);
                /*header('Content-Disposition: attachment; filename="'.$File.'"');
                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-Transfer-Encoding: binary');
                $Len = $this->_EstimateNewArchSize();
                if ($Len!==false) header('Content-Length: '.$Len);


I also substitute the headers for other browsers with that i have found for other downloads on my code.

If you want to include this code (or similar) to opentbs source code you can make download working better.

Thanks for reading
By: Skrol29
Date: 2012-04-12
Time: 18:56

Re: openTBS download headers IE problem

Hi Puttext,

Thanks for reporting this problem. I will exterminate the behavior and apply your patch if all is ok.

Meanwhile, remember you can merge and download with your own headers using :
$TBS->Show(OPENTBS_NOHEADER);

By: Fabio Rocha
Date: 2012-08-28
Time: 22:08

Re: openTBS download headers IE problem

I have the same problem. I tried to use the OPENTBS_NOHEADER but without success. I get the output rendered by the framework I'm using (yii). Had to change the code as puttext and use 'Pragma: '. Iḿ using version 1.7.6.
By: Shailesh
Date: 2013-05-18
Time: 13:02

Re: openTBS download headers IE problem


ob_end_clean();
will help