How to force file download with PHP

后端 未结 11 1738
被撕碎了的回忆
被撕碎了的回忆 2020-11-21 23:13

I want to require a file to be downloaded upon the user visiting a web page with PHP. I think it has something to do with file_get_contents, but am not sure how

11条回答
  •  Happy的楠姐
    2020-11-21 23:20

    http://php.net/manual/en/function.readfile.php

    That's all you need. "Monkey.gif" change to your file name. If you need to download from other server, "monkey.gif" change to "http://www.exsample.com/go.exe"

提交回复
热议问题