Robin S Posted October 28, 2023 Share Posted October 28, 2023 Does anyone know of a way to prompt a file download from code that is executed in the Tracy Console panel? When I try things that would normally prompt a download if executed in a template file, such as... header('Content-type: text/csv'); header("Content-Disposition: attachment; filename=myfile.csv"); // ... ...or... $files->send($myfile, ['forceDownload' => true]); ...the output is always sent directly to the Console panel and no download is prompted. No big deal if it's not possible but sometimes it would be handy to export some data or files in the form of a download using the Console panel. Maybe @adrian or anyone else knows a solution for this? Thanks in advance. Link to comment Share on other sites More sharing options...
adrian Posted October 30, 2023 Share Posted October 30, 2023 Hey @Robin S - good question. I have played around a little without any success. I feel like I am missing something obvious like output buffering getting involved, but perhaps it is just down to the way I instantiate a PW template and render it via AJAX https://github.com/adrianbj/TracyDebugger/blob/ec79b76bf0443118a6c402c9ffe2a9c491a8b5cc/includes/CodeProcessor.php#L197-L203 I'll keep mulling it over, but not sure what the solution might be at the moment. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now