i would like to copy a zip-file from an external server to the directory where the script run.
for example:
$thezipfile = "http://www.yxz.com/user/login/userid/1234/password/1234/page/L2V4cG9ydC9kb3dubG9hZC90L01RPT0vYy9NZz09Lw=";
This doesnt work (download.php):
$save = file_put_contents('newfile.zip',$thezipfile);
after that, there is a file on my server called 'newfile.zip', but...its empty!??
You have not got any file contents to put into the new file.
You would need to file_get_contents($thezipfile)
before you file_put_contents()
You need to actually read the external file before saving. Change your second line to
file_put_contents('newfile.zip',file_get_contents($thezipfile));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.