Closed (fixed)
Project:
Drupal core
Version:
6.20
Component:
forms system
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
6 Jun 2011 at 10:25 UTC
Updated:
23 Jun 2011 at 04:22 UTC
I have to create csv file from data which I get from database.
On Interface I am selecting nodes. After selecting I do submit form;
in hook_submit I collect the information and query database
for example db_fetch_array()
after this data I convert array to string;
and I want to allow user to save this information as csv on his computer. I am doing next:
drupal_set_header('Content-Type: application/text; charset=utf-8');
drupal_set_header('Content-Disposition: attachment; filename=export.csv');
print biblio_csv_export($node);//This 3 lines doesn't work in hook_form_submit
But somehow it doesn't work for me.. What can be the problem?
Comments
Comment #1
korgx commentedHi
I found the way how to fix it
It is just doing form['#redirect'] = false;
Maybe someone has the same problem and find it helpful;
thanks