An important addition to this.
I did exactly as Guttorm pointed out. It worked like a charm for CSV files in both Opera and IE.
Then I continued with the project and tried to download a dynamically generated PDF file. Saving or opening in Opera was no problem again, but in IE I could only save. Trying to open would download the file all right, but Acroread does not open te file and gives an error message "file not found".
I copied this piece of code from the PHP manual:
Code:
<?php
$mm_type="application/octet-stream";
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($url)) );
header('Content-Disposition: attachment; filename="'.basename($url).'"');
header("Content-Transfer-Encoding: binary\n");
$fp = fopen($url, 'rb');
$buffer = fread($fp, filesize($url));
fclose ($fp);
print $buffer;
?>
(The code is on the manual page of the "header" function on php.net and posted by rich at pioneering-principles dot co dot uk.)
Now don't ask me which line exactly causes the opening to work. I was in a hurry (who isn't?) and I was happy enough to have it working.
Opening the file in IE 6 works now, and it still works in Opera.
jlinkels
Edit: PS how do you guys get that nicely colored PHP syntax posted here?