Welcome Guest, Not a member yet? Register   Sign In
File helper() write file? Download prompt!

Hi all,

I have been playing around with the file helper class.

Basically I want a query result in a csv file to be downloaded by the user, NOT written to a folder somewhere.

So this is what happens:

-Enters query (works)
-Query result in CSV (works)
-Query result in file, download prompt for user to download .csv file (not functioning)

This is what I have

//csv data

write_file('', $csv);

I had a look at the File Helper but no code relevant to what I am trying to achieve.

Thanks for your time Smile


Click here

hope it works for you too... :-)

use the download helper


$data = 'Here is some text!';
$name = 'mytext.txt';

force_download($name, $data);


Thanks bubbofoley this was what I wanted to hear ! Smile

Theme © iAndrew 2016 - Forum software by © MyBB