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

korgx’s picture

Status: Active » Fixed

Hi
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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.