A script that downloads files from another server to my server ?

Discussion in 'PHP' started by daryo, Aug 4, 2008.

  1. #1
    Hello,
    I have shared hosting account without shell access, so I want to know if there's any script that will download files from another server to my server (just like wget, but in php) ?

    Thanks in advance!
     
    daryo, Aug 4, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    The easiest way would be:
    
    $source = 'http://example.com/file.zip';
    $target = 'files/file.zip';
    
    if (@copy($source, $target))
    {
        echo 'File copied';
    }
    else
    {
        echo 'Could not copy file';
    }
    
    PHP:
     
    nico_swd, Aug 4, 2008 IP
    daryo likes this.
  3. daryo

    daryo Well-Known Member

    Messages:
    1,343
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Works like a charm ;) Thank you very much, rep added!
     
    daryo, Aug 4, 2008 IP
  4. lovelycesar

    lovelycesar Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try to use RapidLeech, it works too
     
    lovelycesar, Aug 4, 2008 IP
  5. zuly

    zuly Well-Known Member

    Messages:
    317
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #5
    is it legal to use this method to copy wordpress installation directly from their server to mine?
     
    zuly, Feb 5, 2009 IP
  6. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #6
    Yes, I use a PHP fetcher + unzipper to speed up my Wordpress installs myself. Takes seconds instead of however long it takes you to upload that many files.
     
    Danltn, Feb 6, 2009 IP