Dowloading attatchments with IE...

Joe Smargie joes@th.net
Wed, 29 Nov 2000 13:50:50 -0800


    I'm using-
    IMP: 2.3.6
    Apache: 1.3.9 w/PHP 4 build 5 (not using PHPLib)
    IE 5.5 SP1 and Netscape 4.76

    I can't download things that are attatched to an email using IE. When I
click on the attachment, I get get a blank window instead of a dialog save
box. The code in view.php seems to be set to issue the proper headers:

    case DOWNLOAD_ATTACH:
         /* This should force a save file dialog. */
         header('Content-Type: application/octet-stream');
         header('Content-Disposition: attachment;filename="' . $mime['name']
. '"');
         break;

    However I snooped HTTP talk going between the browser and server. The
proper header doesn't seem to be passed out when using IE:

<request sent when I click on download link>
HTTP: GET
/horde/imp/view.php?mailbox=INBOX&index=55&bodypart=3&actionID=13&mime=YTo2O
ntzOjQ6Im5hbWUiO3M6MTQ6IkFETUlOMjBORVcucGRmIjt
zOjQ6InR5cGUiO2k6MztzOjM6InN1YiI7czoxMjoib2N0ZXQtc3RyZWFtIjtzOjg6ImVuY29kaW5
nIjtpOjM7czo3OiJpbWFwX2lkIjtzOjE6IjMiO3M6NzoiY2hhcnNldCI
7czo4OiJ1cy1hc2NpaSI7fQ==/ADMIN20NEW.pdf HTTP/1.1
HTTP: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/pdf, */*
HTTP: Referer:
http://t4.cyberc.com/horde/imp/message.php?index=55&array_index=5
HTTP: Accept-Language: en-us
HTTP: Accept-Encoding: gzip, deflate
HTTP: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
HTTP: Host: t4.cyberc.com
HTTP: Connection: Keep-Alive
HTTP: Cookie: chuckmIMPlang=en; Horde=d66457c9579a8e772d3da5c477bebc3e

<response from server>
HTTP/1.1 200 OK
HTTP: Date: Wed, 29 Nov 2000 16:35:16 GMT
HTTP: Server: Apache/1.3.9 Ben-SSL/1.37 (Unix) PHP/4.0.2 AuthMySQL/2.20
HTTP: X-Powered-By: PHP/4.0.2
HTTP: Set-Cookie: chuckmIMPlang=en; expires=Thu, 29-Nov-01 16:35:16 GMT;
path=/
HTTP: Keep-Alive: timeout=15, max=98
HTTP: Connection: Keep-Alive
HTTP: Transfer-Encoding: chunked
HTTP: Content-Type: text/html


But when I use netscape the server spits out the headers specified by the
header() command in view.php

<request to server>
HTTP: GET
/horde/imp/view.php?mailbox=INBOX&index=55&bodypart=3&actionID=13&mime=YTo2O
ntzOjQ6Im5hbWUiO3M6MTQ6IkFETUlOMjBORVcucGRmIjt
zOjQ6InR5cGUiO2k6MztzOjM6InN1YiI7czoxMjoib2N0ZXQtc3RyZWFtIjtzOjg6ImVuY29kaW5
nIjtpOjM7czo3OiJpbWFwX2lkIjtzOjE6IjMiO3M6NzoiY2hhcnNldCI
7czo4OiJ1cy1hc2NpaSI7fQ==/ADMIN20NEW.pdf HTTP/1.0
HTTP: Referer:
http://t4.cyberc.com/horde/imp/message.php?index=55&array_index=5
HTTP: Connection: Keep-Alive
HTTP: User-Agent: Mozilla/4.76 [en] (Win98; U)
HTTP: Host: t4.cyberc.com
HTTP: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*
HTTP: Accept-Encoding: gzip
HTTP: Accept-Language: en
HTTP: Accept-Charset: iso-8859-1,*,utf-8
HTTP: Cookie: chuckmIMPlang=en; Horde=d3e262784e43ce662f6b7638458c9a65


<response from server>
HTTP: HTTP/1.1 200 OK
HTTP: Date: Wed, 29 Nov 2000 16:35:16 GMT
HTTP: Server: Apache/1.3.9 Ben-SSL/1.37 (Unix) PHP/4.0.2 AuthMySQL/2.20
HTTP: X-Powered-By: PHP/4.0.2
HTTP: Set-Cookie: chuckmIMPlang=en; expires=Thu, 29-Nov-01 16:35:16 GMT;
path=/
HTTP: Keep-Alive: timeout=15, max=98
HTTP: Connection: Keep-Alive
HTTP: Transfer-Encoding: chunked
HTTP: Content-Type: text/html

So it seems that IE is doing something that cause Apache not to send out the
headers which are dumped into the header table using header(); in view.php.
However the requests look ok for each of them. I know that IE is screwey and
doesn't properly do mime, but the bottom line is people use IE and so I need
to try and work around this somehow. Any ideas?

    A thousand thanks,
    -Joe S.

P.S. Please do not respond with "well I tried d/l'ing attatchments with IMP
2.2.blah with both netscape and IE and it worked just fine. blah blah
blah.." As I said I'm using IMP 2.3.6; I realize this is pre-alpha but it
seems to work pretty well with the execption of this one issue.


[------------------------------------------------]
Joe Smargie <joes@th.net>
Systems Administrator - Technology Horizons

1-413-253-7700 (888-762-2283)
[------------------------------------------------]

This message is intended to be confidential and may be legally privileged.
It is intended solely for the addressee.  Unless authorized, any disclosure,
copying, distribution or action taken or omitted in reliance on this message
is prohibited and may be unlawful.