Downloading attachments (bug?)

Cort Tompkins rtompkin@cs.odu.edu
Thu, 24 May 2001 19:14:22 -0400 (EDT)


Hello,

I've had issues downloading attachments with the last few 2.2.X releases 
(including 2.2.5) and I'm wondering if this is a bug.  By default IMP generates 
a URL (on the message page) of the following form to save an attachment:

http://mysite.com/horde/imp/view.php3/ATTACHMENT.EXT?urlvars=blahblah

Clicking on this link gives me an "Internal Server Error" (which, because of 
the way I have PHP setup, may be the same as a 404) even before the save dialog 
appears.

However, if I modify /horde/imp/lib/mimtypes.lib to generate the URL in the 
following form everything works great:

http://mysite.com/horde/imp/view.php3?urloptions=blahblah/ATTACHMENT.ext

I've verified this problem using both IE 5.5 and Konqueror 2.1.1.  My website's 
running PHP 4.0.5 with IMP 2.2.5 on a FreeBSD 4.1.1/Apache 1.3.14 shared 
server.  

Below is a diff of the change I made:

=============
--- ./horde/imp/lib/mimetypes.lib.orig	Thu May 24 18:26:28 2001
+++ ./horde/imp/lib/mimetypes.lib	Thu May 24 18:59:34 2001
@@ -167,7 +167,7 @@
     // FIXME: (dependancy on imp)
     global $imp, $index; $mailbox = $imp->mailbox;
     if ($mime->conf['download'])
-      $row .= '<td><a href="' . $sess->url('view.php3/' . urlencode
(decode_mime_string($mime->name)) . '?mailbox=' . urlencode
($mailbox)) . "&index=$index&bodypart=$mime->imap_id&actionID=" . 
DOWNLOAD_ATTACH . '"><img src="' . $default->graphics_url . '/download.gif" 
alt="' . $lang->imp->download . '" border="0"></a></td>';
+      $row .= '<td><a href="' . $sess->url('view.php3?mailbox=' . urlencode
($mailbox)) . "&index=$index&bodypart=$mime->imap_id&actionID=" . 
DOWNLOAD_ATTACH . '/' . urlencode(decode_mime_string($mime->name)) . '"><img 
src="' . $default->graphics_url . '/download.gif" alt="' . $lang->imp-
>download . '" border="0"></a></td>';
     else
       $row .= '<td>&nbsp;</td>';
     

--
Cort Tompkins