Results 1 to 4 of 4

Thread: Php Image Download on Server function

  1. #1
    Join Date
    Oct 2011
    Posts
    11

    Default Php Image Download on Server function

    <?php
    function downimage($image_url, $image_name, $image_path){
    $image_name = $this->pretty_string($image_name);
    $image_file = $image_name . '.jpg';
    if( ! file_exists($image_path . $image_file) ){
    $ch = @curl_init($image_url);
    $fp = @fopen('../'.$image_path .'/'. $image_file, 'w+');
    @curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    @curl_setopt($ch, CURLOPT_REFERER, $image_url);
    @curl_setopt($ch, CURLOPT_HEADER,0);
    @curl_setopt($ch, CURLOPT_FILE, $fp);
    @curl_exec($ch);
    @curl_close($ch);
    @fclose($fp);
    }
    }
    ?>

  2. #2
    Join Date
    Apr 2012
    Posts
    6

    Default

    nice, thx :)

  3. #3
    Join Date
    May 2012
    Posts
    5

    Default

    great help. thank you

  4. #4
    Join Date
    Jun 2012
    Posts
    5

    Default

    Very usefull.Hope to see more releases.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •