I am writing a plugin that will allow the user to export a csv file from the plugin admin page.
I am finding that I can't send the file I generate as the headers are always being sent by the "admin-header.php" file. (see below):
Warning: Cannot modify header information - headers already sent by (output started at XXX/wp-admin/admin-header.php:19)...
is there a way I can stop these headers being sent? or at least get my file to the top of the headers queue? There does seem to be a send_headers hook, but all the documentation seems to say that it fires after the HTTP headers have been sent, not before!