On 18 Sep 2009, at 9:19, Randy Moller wrote:
I recently modified the report module of our backoffice softwareapplication to serve up a content-disposition: attachment csv on demand instead of actually creating a tmp file and a link to it (optimization).It's being served in an ssl environment. The problem is, on our test server, this process works as advertised (save dialog), but in production, the disposition is being ignored (all browsers), and thecontent is being served inline and dumped to the browser anyway. It's apretty standard header arrangement (below). Obviously, there must be some difference on the server side, but no luck in finding it so far.Has anyone had a similar issue that can shed some light? header("Content-type: text/x-csv"); header("Content-Length: ".strlen($csv_raw_output)); header("Content-Disposition: attachment; filename=".$filename); print $csv_raw_output; exit;
Here is what I use (I can share my entire script if you want to know what the variables contain):
ini_set('zlib.output_compression', 'Off');
header('Content-Description: File Transfer');
header('Content-Type: ' . $ctype);
header('Content-Disposition: attachment; filename="' .
basename($file) . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Cache-Control: private', false);
header('Content-Length: ' . $filesize);
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
