[dev] IE and download problems

Leena Heino Leena.Heino@uta.fi
Tue, 1 Oct 2002 12:20:11 +0300 (EEST)


On Tue, 1 Oct 2002, Leena Heino wrote:

> It seems that IE download works in Horde CVS HEAD versions because
> in horde/lib/Browser.php there are these lines:
> if ($this->hasQuirk('cache_ssl_downloads')) {
>     header('Expires: 0');
>     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
>     header('Pragma: public');
> }
>
> Any chance that this might be backported to Horde CVS RELENG version?
It would seem that downloadHeaders function was added to Horde 2.2
(RELENG) and if this function were to be used in IMP 3.2 (RELENG) then
IMP would not be backwards compatible to Horde versions 2.0 or 2.1.

Therefore it seems that in order for IMP to work with IE and with Horde
version 2.0 and 2.1 is to add "Pragma: public" to imp/folders.php and
imp/view.php. If backwards compatibility to Horde 2.0 or 2.1 is not
important then patch horde/lib/Browser.php and use downloadHeaders()
function in IMP.

Here's the patch for IMP(RELENG) to use "Pragma: public":
--- imp/folders.php.orig	Sat Jun 22 08:43:51 2002
+++ imp/folders.php	Mon Sep 30 20:47:14 2002
@@ -146,6 +146,7 @@
           * things work. I don't really want to know. */
          if ($browser->hasQuirk('break_disposition_header')) {
              header('Content-Disposition: filename=' . $download_folders[0] . '.mbox');
+             header("Pragma: private");
          } else {
              header('Content-Disposition: attachment; filename=' . $download_folders[0] . '.mbox');
          }

--- imp/view.php.orig	Mon Sep 30 18:05:35 2002
+++ imp/view.php	Mon Sep 30 20:52:13 2002
@@ -55,6 +55,7 @@
       * things work. I don't really want to know. */
      if ($browser->hasQuirk('break_disposition_header')) {
          header('Content-Disposition: filename=' . MIME::decode($mime->name));
+         header("Pragma: private");
      } else {
          header('Content-Disposition: attachment; filename=' . MIME::decode($mime->name));
      }
@@ -121,6 +122,7 @@
       * things work. I don't really want to know. */
      if ($browser->hasQuirk('break_disposition_header')) {
          header("Content-Disposition: filename=$name");
+         header("Pragma: private");
      } else {
          header("Content-Disposition: attachment; filename=$name");
      }


Here's the patch for Horde(RELENG) to add "Pragma: public":
--- horde/lib/Browser.php.orig	Mon Sep 16 16:23:32 2002
+++ horde/lib/Browser.php	Tue Oct  1 11:56:43 2002
@@ -450,6 +450,13 @@
         if (!is_null($cLength)) {
             header('Content-Length: ' . $cLength);
         }
+
+        /* Overwrite Pragma: and other caching headers for IE. */
+        if ($this->hasQuirk('cache_ssl_downloads')) {
+            header('Expires: 0');
+            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+            header('Pragma: public');
+        }
     }

 }

-- 
  -- Leena Heino (liinu at uta.fi)