How to download a file to server PHP?

前端 未结 4 1792
傲寒
傲寒 2021-01-24 05:04

Is it possible with PHP script to have the script download a file on a remote server to my web server?

I have my own webserver and domain. I want to put a php script on

4条回答
  •  无人及你
    2021-01-24 05:34

    Sure, you'll need write permissions somewhere on the file system (where you want to save this file), file_get_contents can take a URL as its argument, you just need to write the resulting string to a new file

    I'd personally do this by calling out to the shell and invoking wget or similar if i were on a linux box.

提交回复
热议问题