I have an application that is generating a file, and I have that working beautifully using CURL. However, when the page reloads and the file is out there, I want to automatically trigger the download without the user having to click on the link to launch it in another window. At the moment, the closest thing I could come up with is using JavaScript to window.open, but then that pop-up window is left out there. Is there a way through PHP, or something else, where I can trigger the other URL without creating a new window?
I tried just doing another instance of CURL, but that doesn't work for my application. I have many header() clauses in the file so that it automatically downloads, and CURL returns all kinds of code on the screen... and doesn't actually download the file.
Any ideas?