I'm adapting the email_export plugin for my own purposes because frankly I don't know enough about file streams to create a document. (to make a long story short, it will export data other than emails that I need for my store). My question really doesn't impact the functionality of the new page (it works), it's just not working as "cleanly" as I prefer.

Thus, I simply am curious: When you start streaming to a new document (via all the "header" functions), and then echo the document content ($exporter_output), it seems to me that it interrupts the php of the document.

Thus, when you have a file saved to server, email_export page then refreshes and lists "123 processed" in an alert message at the top. However, when streaming to download, the refresh (which should be called as well in the code), doesn't happen, and it appears the code is cut off after that, as (I believe the reason is) all output is streaming to the downloaded document, not to the email_export php.

My question is whether there's any way to interrupt the stream so that the refresh can be completed after the file is downloaded to report the success. It's not critical, it would just make the reports more accurate (eg: if I do one export and "no records" result, I get a refresh with "no records" showing, but if I change the parameters and then download a file with several records, it doesn't refresh and I still see the "no records" message.

Thanks