Re: JS alert that links to a file

From: Date: Mon, 27 Jul 2009 12:37:12 +0000
Subject: Re: JS alert that links to a file
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-295867@lists.php.net to get a copy of this message
Hey all, With LinuxMan's help I got this working. It was a bit tricky as it's an AJAX environment, but what I did was create a separate page with code similar to what he has below and then call it from the JS side and it works great. Thanks all, and especially LinuxManMikeC for the key! Skip Skip Evans wrote:
LinuxManMikeC wrote:
<?php header('Content-type: text/csv'); header('Content-Disposition: attachment; filename="file.csv"'); echo 'field1,field2,field3,field4'; ?>
Okay, right, I remember this. But it has to be in it's own file, otherwise you get the 'headers already sent error', right? Is there any way around that? Any way to get it right at the end of where the file is created??? Thanks! Skip
-- ==================================== Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison WI 53703 608.250.2720 http://bigskypenguin.com ------------------------------------ Those of you who believe in telekinesis, raise my hand. -- Kurt Vonnegut

« previous php.general (#295867) next »