[imp] Download links

Michael M Slusarz slusarz at bigworm.colorado.edu
Mon Dec 2 23:05:33 2002


Why do all browsers suck so much...  It turns out that the little hack to
"fool" browsers into correct download behavior does not work without the
PATH_INFO information.  Unfortunately, PATH_INFO is turned off by default in
Apache 2 installations.  Thus, downloading with the latest versions of
Netscape (7) or Mozilla (1.2) produces download filenames (at least on
windows) with .php added to the end.  Really annoying.

Here is my proposed solution... Since we already require the webserver we
are running to recognize index.php as the default webpage for a directory,
we should create a directory under horde (named view/ or download/) that
contains a single index.php file.  Browser::downloadHeaders() then creates a
link to this directory (e.g.
www.example.com/horde/download/?param1=value1;param2=value2).  This
index.php simply includes the relevant module's view.php file and the file
gets downloaded.  Since there is no ".php" anywhere in the URL using this
method, the browser is forced to use either the filename passed to it as the
last parameter (as we do currently), or it uses the Content-disposition
header sent to it.

Does this sound like a good way of solving this problem?  (It is extremely
nice since it doesn't require any changes to individual module's view.php
file - and hopefully every module is using Browser::downloadHeaders() anyway
to generate download links).

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the imp mailing list