I'm generating a file using the query
SELECT * INTO OUTFILE " . "'c:/myfile.csv'" . " FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM sample
My file is now in C:/myfile.csv. I want the user to download the file. How can I achieve this?
You could :
In PHP, something like this should do the trick :
header('Content-Disposition: attachment; filename="my-file.csv"'); // The name which will be suggested to the user
readfile('c:/myfile.csv'); // outputs the content of the file