[dev] IE and download problems

Leena Heino Leena.Heino@uta.fi
Mon, 30 Sep 2002 19:05:33 +0300 (EEST)


On Mon, 30 Sep 2002, Jan Schneider wrote:

> Leena Heino wrote:
>
> >Any news on resolution to this problem? Other than not using IE?
> >Has anyone else had any problems with CVS RELENG version and
> >downloading attachments and IE?
> >
> Try what I just committed.
This time I'll try to send this also to the list. The fix in the
CVS did not work. But I did some further testing with imp/view.php and the
attached patch seems to make it work with IE 5.5, Mozilla 1.1, Netscape 4.79.

This patch removes the application/x-unknown-application-octet-stream and
replaces it with application/octet-stream mime type. This patch also
removes IE quirk feature. The mime type correction and IE quirk removal
was needed to make it work with IE.

This patch is for CVS RELENG:
--- imp/view.php.orig	Mon Sep 30 18:05:35 2002
+++ imp/view.php	Mon Sep 30 18:50:28 2002
@@ -46,18 +46,19 @@
 /* Run through action handlers */
 switch ($actionID) {
  case DOWNLOAD_ATTACH:
-     header('Content-Type: application/x-unknown-' . $mime_types[$mime->type] . '-' . $mime->subtype);
+     //header('Content-Type: application/x-unknown-' . $mime_types[$mime->type] . '-' . $mime->subtype);
+     header('Content-Type: ' . $mime_types[$mime->type] . '/' . $mime->subtype);

      /* This should force a save file dialog. According to a note
       * in MSDN, the suggested filename should NOT be in quotes.
       *
       * For IE 5.5, we break the header in a special way that makes
       * things work. I don't really want to know. */
-     if ($browser->hasQuirk('break_disposition_header')) {
-         header('Content-Disposition: filename=' . MIME::decode($mime->name));
-     } else {
+     //if ($browser->hasQuirk('break_disposition_header')) {
+     //    header('Content-Disposition: filename=' . MIME::decode($mime->name));
+     //} else {
          header('Content-Disposition: attachment; filename=' . MIME::decode($mime->name));
-     }
+     //}
      break;

  case VIEW_ATTACH:


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