[imp] Attachments are saved as view.*, bug?

Ahmed ashihab@alcahest.com
Mon, 27 May 2002 13:57:53 +0100


Quoting Jan Schneider <jan@horde.org>:
 
> > I've been noticing that any attachments, when downloaded or viewed the
> 
> There are a lot of problems with several IE versions, some are quirky some
> are not.
> 
> Try commenting out line 125 (break_disposition_header) in lib/Browser.php
> and see if it helps. 
> 
that did not help with IE 5.5

Anyway I've corrected the problem with opera, it was set to report itself as MSIE, which it shouldn't.

I've found another problem, MIME parts with filenames containing spaces do not get saved as the complete filename, rather the filename stops at the first space character and the browser will then report it as "unknown type" since it does not have an extension.

I've crudely corrected this problem by adding quotes to the file name (see patch below):

*** view.php	Mon May 27 13:54:10 2002
--- view.php.new	Mon May 27 13:55:54 2002
***************
*** 48,56 ****
        * 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->getName()));
       } else {
!          header('Content-Disposition: attachment; filename=' . MIME::decode($mime->getName()));
       }
       break;
  
--- 48,56 ----
        * 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->getName()) . '"');
       } else {
!          header('Content-Disposition: attachment; filename="' . MIME::decode($mime->getName()) . '"');
       }
       break;

Ahmed...