1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

anyone know a php that lets me grab a remote file to my web server?

Discussion in 'Black Hat SEO' started by SleepieGirl, Oct 6, 2010.

  1. SleepieGirl

    SleepieGirl Regular Member

    Joined:
    Mar 7, 2009
    Messages:
    439
    Likes Received:
    290
    Occupation:
    Need Custom Programs? Message Me!!!
    Location:
    TenDollarBlog.com
    i need a php script that just lets me put a url into it and retrieves the file...
     
  2. SleepieGirl

    SleepieGirl Regular Member

    Joined:
    Mar 7, 2009
    Messages:
    439
    Likes Received:
    290
    Occupation:
    Need Custom Programs? Message Me!!!
    Location:
    TenDollarBlog.com
    an image file
     
  3. radi2k

    radi2k Junior Member

    Joined:
    Nov 29, 2009
    Messages:
    117
    Likes Received:
    34
    Location:
    Germany
    simple:
    Code:
    <?php
    $content = file_get_contents('http://www.example.com/image.png');
    file_put_contents('image.png', $content);
    ?>
    
    this code will download the image from the given url and will save it locally on the server as image.png
     
    • Thanks Thanks x 1
  4. SleepieGirl

    SleepieGirl Regular Member

    Joined:
    Mar 7, 2009
    Messages:
    439
    Likes Received:
    290
    Occupation:
    Need Custom Programs? Message Me!!!
    Location:
    TenDollarBlog.com
    thanks.
    hey how would i make this accept like this

    Code:
    http://www.mysite.com/mysite.php?http://www.imagesite.com/image.jpg
     
  5. stradivari

    stradivari Junior Member

    Joined:
    Mar 25, 2010
    Messages:
    127
    Likes Received:
    28
    Location:
    I don't remember
    Look here: http://www.w3schools.com/php/php_get.asp or search "query strings" in PHP.
     
    • Thanks Thanks x 1
  6. SleepieGirl

    SleepieGirl Regular Member

    Joined:
    Mar 7, 2009
    Messages:
    439
    Likes Received:
    290
    Occupation:
    Need Custom Programs? Message Me!!!
    Location:
    TenDollarBlog.com
    Code:
    <?php
    $image = $_REQUEST['image'] ;
    $name = $_REQUEST['name'] ;
    $content = file_get_contents("$image");
    file_put_contents("./images/$name.jpg", $content);
    ?>
    Code:
    http://www.mysite.com/GetImage.php?name=ImageName&image=http://www.imagesite.com/image.jpg
     
  7. rakka

    rakka Newbie

    Joined:
    Aug 14, 2010
    Messages:
    21
    Likes Received:
    7
    You also might want to look at the PHP manual for the command "CURL". Supposedly if you set it up right it can retrieve images even if they are blocked on the other server by a htaccess redirect. Saves you from getting a bunch of those "don't steal my bandwidth" logos.
     
  8. thanhclix

    thanhclix Power Member

    Joined:
    Oct 25, 2008
    Messages:
    646
    Likes Received:
    176
    the script you want is rapidleech. it can download files from any third party file hostings to your server and upload them. Its free but the site is down now so you can google to have latest plugin.
    Posted via Mobile Device
     
  9. SleepieGirl

    SleepieGirl Regular Member

    Joined:
    Mar 7, 2009
    Messages:
    439
    Likes Received:
    290
    Occupation:
    Need Custom Programs? Message Me!!!
    Location:
    TenDollarBlog.com
    i have already pasted the script i wanted right up there...
    thanks anyway.