Alright, went home for lunch and grabbed my old code files... now keep in mind this is PHP but the headers that you need to modify should be the same:
-
<?php
-
-
// Now we'll use header calls to download a file to the client
-
header('Cache-Control: public, must-revalidate');
-
header('Pragma: hack');
-
header('Content-Type: application/vnd.ms-excel');
-
header('Content-Length: '.(string)(filesize($file_path)));
-
header('Content-Transfer-Encoding: binary\n');
-
/*
-
Using the "Content-Disposition" header allows us to provide a recommended filename
-
as well as force the browser to display the save/open dialog.
-
*/
-
header('Content-Disposition: attachment; filename="suggestedfilename.csv"');
-
readfile($file_path);
-
?>
-
I don't know why IE is so hard to deal with, but I need all of these headers to get it to display the 'Open/Save' dialog instead of trying to download the .php page itself. Mozilla was fine with the simple way that you did it.
Anyway, I hope that helps... just remember that you'll need to adapt those header calls to your code