[dev] IE and download problems

Leena Heino Leena.Heino@uta.fi
Tue, 1 Oct 2002 17:32:03 +0300 (EEST)


On Tue, 1 Oct 2002, Jan Schneider wrote:

> BC is an issue, so adding the pragma header to all necessary files is
> the right solution. And this actually fixed your problem?
You were right it needed a bit more than the simple "Pragma: Public".
To find out what was wrong with CVS RELENG I used CVS HEAD version to see
what headers it was supposed to send, because downloading worked with with
IE and CVS HEAD. Then I made the necessary changes to CVS RELENG version.

These patches are tested with following browsers:
IE 5.0/Solaris, IE 5.0/Windows, IE 6/Windows, IE 6sp1/Windows

Tested actions were:
- downloading mail attachment
- downloading mail folder
- exporting address book
- exporting calendar

Horde patch is needed to make the exporting work with IE.
IMP patch is needed to make downloading work with IE.

AFAIK, following patches should not have any BC issues.

Here's the Horde(RELENG) patch:
--- horde/lib/Browser.php.orig	Mon Sep 16 10:30:31 2002
+++ horde/lib/Browser.php	Tue Oct  1 17:24:06 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');
+        }
     }

 }

--- imp/folders.php.orig	Sat Jun 22 05:43:51 2002
+++ imp/folders.php	Tue Oct  1 17:24:06 2002
@@ -149,6 +149,12 @@
          } else {
              header('Content-Disposition: attachment; filename=' . $download_folders[0] . '.mbox');
          }
+         /* Overwrite Pragma: and other caching headers for IE. */
+         if ($browser->hasQuirk('cache_ssl_downloads')) {
+            header('Expires: 0');
+            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+            header('Pragma: public');
+         }
          echo $mbox;
          exit;
      }

--- imp/view.php.orig	Mon Sep 30 14:15:44 2002
+++ imp/view.php	Tue Oct  1 17:24:06 2002
@@ -58,6 +58,12 @@
      } else {
          header('Content-Disposition: attachment; filename=' . MIME::decode($mime->name));
      }
+     /* Overwrite Pragma: and other caching headers for IE. */
+     if ($browser->hasQuirk('cache_ssl_downloads')) {
+         header('Expires: 0');
+         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+         header('Pragma: public');
+     }
      break;

  case VIEW_ATTACH:
@@ -79,6 +85,12 @@

      header('Content-Type: ' . $viewer->getType() . '; charset=' . $viewer->getCharset($ob));
      header('Content-Disposition: inline; filename=' . MIME::decode($mime->name));
+     /* Overwrite Pragma: and other caching headers for IE. */
+     if ($browser->hasQuirk('cache_ssl_downloads')) {
+         header('Expires: 0');
+         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+         header('Pragma: public');
+     }
      print $viewer->render($mime);
      exit;
      break;

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