I have a script to convert MySQL to CSV. What I need to do is have the page prompt the user to download the file rather than have it open in the browser. How would I do this?
If the script writes the file to the server's filesystem and you provide a link, not much other than change the file extension of the file to something bizarre.
If the script is streaming the file to the browser, you can use the "Content-disposition" header. Take a look at the PHP online manual under header() to see an example (
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.