NYCPHP Meetup

NYPHP.org

[nycphp-talk] Re: Downloading a CSV file

Faber Fedor faber at linuxnj.com
Tue Sep 7 23:39:34 EDT 2004


On 07/09/04 23:04 -0400, Jeff Siegel wrote:
> Here's some pseudo code to get you started. It should prompt the user 
> with a dialog box to save the file. 

That's what I'm looking to do!

> However, keep in mind that if you 
> have really large datasets (40,000 rows+) this may not work

I was thinking more along the lines of 50 rows. :-)

> Header("Content-type: text/csv\n",true);
> Header("Content-Disposition: attachment; filename=myfilename.csv",true); 
> 
> Header("Pragma: no-cache",true);
> Header("Expires: 0",true);
> print $csv_output;
> exit;	

That's it!  Thanks!


-- 
 
Regards,
 
Faber                     

Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com






More information about the talk mailing list