Date: 06/19/01
- Next message: Ilya Khandamirov: "[phplib] Template class (dynamic blocks)"
- Previous message: Bob Bowker: "Re: [phplib] csv file download... (simple newbie question?)"
- In reply to: Christopher J. Bobcowski: "[phplib] csv file download... (simple newbie question?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
For the download try the following:
create a link to a script download.php which will read the csv file and
send it to the user like this:
header("Content-Type: application/force-download");
header("Content-Length: ".filesize($filename));
header("Content-Disposition: attachment; filename=".$orig_filename);
readfile($filename);
exit;
This should give him a download dialog box and set the filename to
$orig_filename.
hope this helps
ciao
andre.
Christopher J. Bobcowski wrote:
>hi.. so this should be pretty simple, but i'm confused just the same.
>i've got my php page to generate a healthy mySql result set, and displaying
>the table. i'd like to add a link/button to download a CSV version of the
>results, but am unsure of the best way to do this. i can display the csv
>version using show_result(), but i'd rather see a "save as" dialog pop up.
>i thought of creating a tmpfile (maybe compressing it as well), and then
>doing something else.
>
>hmm..also, i'd like to alternate row backgrounds from table.inc. i've found
>Fmt_Table by Michael Kuehne, and i don't think that it's a simple solution
>for the alternating row colors wish (although it's a sweet class). i was
>just wondering if anyone's seen that around. i'm guessing this one'd just
>be extending table.inc, overriding the table_row_open & close functions?
>
>cheers for any help!
>-chris
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: phplib-unsubscribe <email protected>
>For additional commands, e-mail: phplib-help <email protected>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Ilya Khandamirov: "[phplib] Template class (dynamic blocks)"
- Previous message: Bob Bowker: "Re: [phplib] csv file download... (simple newbie question?)"
- In reply to: Christopher J. Bobcowski: "[phplib] csv file download... (simple newbie question?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

