user3091885
user3091885

Reputation: 11

How to download files to the client?

Problem Description:Here's a file, http://www.demo.com/demo.zip, how users can through the website: demo.zip to download this file to user's computer ? How to write this download.php, thank you very much

For some reason, I do not want the user to know the real download address so that only the user can click on a download button in this download.php page, users can download the demo.zip files, and how to do? Thanks

Upvotes: 1

Views: 86

Answers (1)

leofonic
leofonic

Reputation: 331

Take a look at fpassthru: https://www.php.net/manual/en/function.fpassthru.php You can write a file "download.php" which is called with a parameter to determine the file, check for rights to download inside and then pass the file to download to the user.

Upvotes: 1

Related Questions