簡體   English   中英

如何使用php將多個文件從URL下載到服務器

[英]How to download multiple files from url to server using php

我想將文件從clickbank下載到我的服務器上

<?php
    $url = "https://accounts.clickbank.com/feeds/marketplace_feed_v2.xml.zip";
    file_put_contents("Tmpfile.zip", fopen($url, 'r'));
?>

我只得到一個dtd文件,而xml文件沒有下載,它應該有兩個文件,一個dtd和一個xml

我以這種方式下載了.zip-Archive:

if ($fp1 = fopen($url, 'rb')) 
{ 
   $tempname = './downloaded.zip'; 
   if ($fp2 = fopen($tempname, 'wb')) 
   { 
     fwrite($fp2, file_get_contents($file)); 
     fclose($fp2); 
   } 
   fclose($fp1); 
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM