I have had a similar problem and also started
using the Content-Disp. header until I found
out MIE ignoring it.
After I quickly looked over the RFC for this
as far as I have understood this can only be used for multipart documents each providing its own header - e.g. a mail with binary attachments.
Correct me if I'm wrong.
After trying out this and that I finally ended up in the following solution:
Rather than pointing to actual the script for a download link to be displayed, e.g.
/download.php, I link to a URI that does not really exist and which does reference the file to be downloaded by its ID, e.g. /download.php/myfile.php?file_id=0815
Using apache I found it is smart enough to detect that the script to actually invoke is download.php, i.e. apache recognizes that /download.php/ is not a directory.
The file_id is passed to the script just as in the normal case though.
You can even detect what the dummy filename
was about by splitting the $REQUEST_URI if you need this.
For the content type I use application/octet-stream for simplicity as the file is meant to be downloaded anyway rather than being handled by an appropriate application. I did not use any additional http header, anyway, of course this might help browsers, e.g. giving hints about filesize etc. as you already have tries to.
When stupid MSIE 'sees' the link, it prompts you to download the file, providing the last path argument as the filename (myfile.php)
whereas apache invokes the last path argument which indeed is a script (download.php).
In my case the files come from the server filesystem (in directories being out of apache'r reach in order to implement an access control system), but this should work also for files coming from e.g. a database.
I tested this also with NS (Win/Unix), Konqueror and several BeOS Browsers, therefore I consider this procedure working in general.
Art