简体   繁体   中英

Copy a zip file from an external website to my server

I just want to copy this zip file to my server which is in an external website.

A newfile.zip is created each time but this file is empty.

I guess it's because of the format of the url, can i do something ?

<?php
$thezipfile = "http://www.tyre24.fr/user/login/userid/test/password/test/page/L2V4cG9ydC9kb3dubG9hZC90L01RPT0vYy9NVEU9Lw==";
file_put_contents('newfile.zip',file_get_contents($thezipfile));
?>

The link works.

You could always just upload the file and then put the link to the direct download in your site:

<a href="http://mydomain.com/zips/project1.zip">Download Project 1 (zip-file, ...kB)</a>
<a href="http://mydomain.com/zips/project2.zip">Download Project 2 (zip-file, ...kB)</a>

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM