[imp] Re: Users don't want to "download" attachments

Michael M Slusarz slusarz at mail.curecanti.org
Fri Apr 8 13:47:07 PDT 2005


Quoting Matthew Boehm <mboehm at cytelcom.com>:

> OK. For some strange reason, this behavior was changed from pre 4.x imp.
>
> In old imp, a person would receive a word, or excel attachment. The filename
> would have a link and the correct icon would be displayed. When a person
> clicked on the link, the file would be opened in a new browser window by the
> application itself. Ex: Excel would launch itself and be "inside" the
> browser much like Adobe PDFs.

The "strange reason" you are talking about why the behavior change was 
because pre 4.x imp was badly broken.  The old way was *completely* not 
either cross-browser nor cross-OS.  Sure, if you are using Internet 
Explorer on Windows it may have worked, but it caused completely 
unpredictable results if you were using, say, Netscape on Linux.  One 
of the worse things you can do in designing an application is 
displaying something without having any idea how the end-user is going 
to eventually see it.  So we fixed IMP/Horde so that it prevented these 
"we don't know how this is going to display on your particular browser" 
with the current solution which ensures that consistent behavior 
happens cross browser and cross OS.

> Now, in imp 4.0, when a person clicks on the link, instead of getting the
> old behavior, they are prompted with this error about not finding xlhtml or
> some other program. This is bad. This is not expected behavior. So I went
> into horde/config/mime_types.php and commented out all instances of
> "msexcel" and "msword".

For icons, add each msword/excel/pdf mime types you want to show a 
special non-default icon for in the default icon array (it's near the 
top of the file).  Make sure all 'msexcel' and 'msword' options are 
disabled.  Then change the following lines in lib/MIME/Contents.php 
(it's line 835 in the HEAD version - you will have to search for it in 
whatever version you are using) from:

       if (!$this->_links ||
           (!$attachment && empty($bytes)) ||
           !isset($this->_viewID['view']) ||           is_a($viewer, 
'MIME_Viewer_default')) {

to:

       if (!$this->_links ||
           (!$attachment && empty($bytes)) ||
           !isset($this->_viewID['view'])) {

michael

_______________________________________
Michael Slusarz [slusarz at curecanti.org]


More information about the imp mailing list