Merhaba arkadaşlar video scripti yazıyorum ben video resimlerini alıyorum ama artık kendi sunucuma almak istiyorum şimdi onuda alıyorum , ama resmi videoekle.php nin olduğu yere çekiyor benim istediğim bellirtiği klasöre çekmesi, kullandığım fonksiyon

  function file_download($link,$dosya_adi=NULL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$dosya=curl_exec($ch);
curl_close($ch);
 
if($dosya_adi==NULL){
$dosya_adi=explode("/",$link);
$dosya_adi=array_reverse($dosya_adi);
$dosya_adi=$dosya_adi[0];
}
 
$fp = fopen($dosya_adi,'w');
fwrite($fp, $dosya);
fclose($fp);
}
Kullanımı

$file_DDDD = file_download("http://img.youtube.com/vi/".$embed."/2.jpg","$embed.jpg");
benim tek istediğim aldığı resmi bellirtiğim yere yüklemesi.

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 20:08:30 -->-> Daha önceki mesaj 20:01:03 --

Sorun Çözülmüştür.

Çözüm

$file_DDDD = file_download("http://img.youtube.com/vi/".$embed."/2.jpg","../videoresim/$embed.jpg");