I'm trying to use headers to point the browser to a file download, but I run into the headers already sent error. To rectify this I tried using output buffering, but when I tried this the file would download but would contain an extra 1.6kb of data and would be corrupt(the 1.6kb extra is the size of my style.css file)
To give some background, I have an index.php file which includes my downloads.php file.
Any insight would be appreciated
Using Headers For Download System
Moderator: General Moderators
I realise that and that's why i've tried to use output buffering, but I still can't manage to get it to work. I believe it might have something to do with the fact that the index file starts output while the downloads.php file is trying to send headers. Whatever the reason is I can't get output buffering to work.