There are many uses in being able to have someone download a file using your script. Security and user verification just being one of them.
Quick way to do this:
$file = file_get_contents('file.zip'); header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename="file.zip"'); header('Content-Length: ' . strlen($file)); echo $file;
This will send the file to the person’s browser and download the file. You can now go ahead and add various checks before you actually start sending the data to them.