I have an array like that
$csvDownload=Array ( [0] => Array ( [serial] => Serial [volume] => Tanksize [manufacturer] => Manufacturer [manufacturerDate] => manufacturerDate [warehouse] => Warehousename [pickLocation] => PickupLocation [pickDate] => pickDate [CompanyName] => Company [nationalBoard] => nationalBoard ) [1] => Array ( [serial] => 20001 [volume] => 120H [manufacturer] => Atlas [manufacturerDate] => 2013 [warehouse] => WAREHOUSE1 [pickLocation] => kanpur [pickDate] => 2/25/2014 [CompanyName] => WIM [nationalBoard] => he ) );what i need to do is
1)download csv
2)after then return $data to controller if i use Exit after the code before return it works download the csv file but session do not print. if i remove exit from code session message print but csv do not download
Please help what i am doing wrong or any way to solve this..!
I need both session flash as well as download the csv file.
I have sample code
In controller
function downloadErrorCSV() {$data=$this->tankmodel->downloadcsv(); $this->session->set_flashdata('successAddBulkTank','success'); redirect('mypage');}In model i have
{some code of model} and $data='sucess'{code of download csv} and then return $data;Now if i place exit after csv download script csv it get downloaded and if remove exit;it do not download the csv I need both download csv and show success message as well.