• I have an *unusual* coding question. I have written a plugin that manages a back-end table and everything is fine displaying the table in an admin page, with additional pages to add, view, and edit rows (items) in the the table. What I want to do is implement an ‘export’ function, where the table can be exported as some sort of slab of data (such as a CSV file or an XML file or even a LaTeX source file). I want to be able to click on the export button (after selecting a format from a dropdown), and have a download start. That is, I want the post action to NOT display anyother admin page, but instead send http headers (eg ‘content-type: text/csv’, etc.). Is this even possible? Or should I just generate a temp file and display a link to this generated file in the fresh admin page?

    I did some searches in the codex and here in the forum, but nothing useful showed up.

  • The topic ‘Sending something other than content-type: text/html’ is closed to new replies.