From: Peter F. <pe...@si...> - 2006-03-17 18:19:57
|
Mar...@fi... wrote: > Howdy Aaron, > > for Internet Explorer: > > When using an attachement Content-Dispositon, it seems the following > headers are also required: > > header("Cache-Control: cache, must-revalidate"); > header("Pragma: public"); > > If you have Cache-Control as no-cache, IE fails. > > The header "Content-Type: application/force-download" is a hack as wel, > but fixed it for IE and FF. Thanks very much, I'll give it a try. My impression, though, was that initiating the download wasn't the problem. It's that phpESP simply wasn't generating the data. This seems to be confirmed by the fact that it also generates a zero-length file if you pick "Save to server", where downloading is not involved. ///Peter > ---- START phpESP/admin/include/where/download.inc ---- > > default: > // CSV, csv_full_header old method, csv_short_header new > method > header("Cache-Control: cache, must-revalidate"); > header("Pragma: public"); > header("Content-Type: application/force-download"); > header("Content-Disposition: attachment; > filename=$name.csv"); > $output = survey_generate_results($type, $sid); > foreach ($output as $row ) { > echo(implode(',', $row) . "\r\n"); > } > > I have done several tests and those two lines fixed my script. (It was > trying to download a .csv) > > ---- END phpESP/admin/include/where/download.inc ---- > > Cheers > Martin > > > php...@li... schrieb am 07.03.2006 18:45:30: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >>>> Patches against current CVS would be graciously accepted. >>> Maybe I can find a PHP hacker here who'd be interested. >> I think the main problem is finding someone who has time :). >> >> >> >> - -- Aaron >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.2 (MingW32) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iD8DBQFEDca6uucONIvD0AMRAv0+AJ90PpWHi4Ld6qoHibXcJV6WfQtJjACeNc67 >> i9VSNo73rRBYQ+NYR3uX8G8= >> =uyq3 >> -----END PGP SIGNATURE----- >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting > language >> that extends applications into web and mobile media. Attend the live > webcast >> and join the prime developer group breaking into this new coding > territory! >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >> _______________________________________________ >> phpESP-general mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpesp-general > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd_______________________________________________ > phpESP-general mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpesp-general > > |