<?php
class fileDownload
{
    private $fileURL;
    private $file;
    private $dir;
    private $curl;
    private $return = array();
    private $content;
    public function __construct($url)
    {
        $this->fileURL = $url;
    }
    public function setDirectory($name)
    {
        if (!is_writable($name) || !is_readable($name))
        {
            exit('<ul>'.$name.' Hatası.<li>Dizin Okuma Modunda Değil</li><li>Dizin Yazma Modunda Değil</li></ul>');
        }
        else
        {
            $this->dir = $name;
        }
    }
    protected function getData()
    {
        $this->curl = curl_init();
        curl_setopt($this->curl,CURLOPT_URL, $this->fileURL);
        curl_setopt($this->curl,CURLOPT_RETURNTRANSFER,1);
        $this->content = curl_exec($this->curl);
        curl_close($this->curl);
    }
    public function saveData()
    {
        preg_match("#http:\/\/.*\/(.*)#i",$this->fileURL,$this->return);
        $this->getData();
        $this->file = fopen($this->dir."/".$this->return[1],"w");
        if (fwrite($this->file,$this->content))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
?>
kullanımı :
$link = "http://www.tumdersler.net/images/analogo.gif";
$file = new fileDownload($link);
$file->setDirectory('upload');
if ($file->saveData())
{
   echo "Dosya download edildi.";
}
else
{
   echo "Dosya download edilemedi. Yeniden Deneyiniz.";
CURL yüklü olması gerekir.
işini görür herhalde