I've created a downloads folder in root, into which I uploaded a file. On my web page I created a link to the file. When I click the link on the published web page, it shifts me to the opened file (instead of downloading to where I usually send downloads).
I tried zipping the file, which works, but I'm on a Mac and PCers tell me a zip file from Mac includes 'other' things with the zipped file which I don't understand, but would instead like to know if there is a simpler way to do this.
So, how do I store the file so that web users can click on download and actually have the file downloaded to their computer instead of opening in a browser page?
These errors were being caused by the order in which your PHP includes were defined. As your header PHP include file was defined before the download script PHP include, the download script was unable to set the header information that is defined within it. I have reversed the two lines on your page so that the download script is called first, and as I see you have adjusted your previous code with that I provided previously, it appears to be working now.
It has been my pleasure. One thing I would like to add is to avoid using GET requests to defined the file to be downloaded. This could be exploited to read from any file on your site and could cause your site to become hacked. I recommend directly linking to the file for download instead.