I have a couple suggestions for the csv formatter in Cobalt.
It would be handy if the mime-type set in formatter_csv.php was text/csv instead of text/plain. The reason for the change is that it seems most browsers will prompt to save the csv as a file using that mime-type. Text/plain just displays in the browser which is not that usefull for csv data.
The default name for saving that csv data is whatever the last part of the URL was. A handier default name could be set by adding Content-Disposition to the header. With both changes to formatter_csv.php my code looks like the following:
function sendHeader()
{
header('Content-type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename="export.csv"; charset=utf-8');
}
I have a couple suggestions for the csv formatter in Cobalt.
It would be handy if the mime-type set in formatter_csv.php was text/csv instead of text/plain. The reason for the change is that it seems most browsers will prompt to save the csv as a file using that mime-type. Text/plain just displays in the browser which is not that usefull for csv data.
The default name for saving that csv data is whatever the last part of the URL was. A handier default name could be set by adding Content-Disposition to the header. With both changes to formatter_csv.php my code looks like the following: