PHP Beginner. File uploading is successful but my browser doesn\'t download the files, instead it reads the file. So i referred other threads and found below code which is not w
You have to use two separate files.
In link page, you can output a HTML like this:
Download file 1
Download file 2
Download file 3
(...)
You can use a , if you prefer.
Then, in download.php:
Select appropriate file using GET/POST parameter ($_GET['file']
in above example);
send appropriate headers (like in your original code);
echo your file (you can use readfile
);
Mandatory: no additional output in this script! Even a single additional space will corrupt downloaded file.