Curl kullanarak yapabilirsin
<?php
error_reporting(0);
set_time_limit(3000);
$dosya = "http://www.google.com.tr/intl/en_com/images/logo_plain.png"; // indireceğin dosyanın adresi
if($dosya){
$dosya_adi = "logo_plain.png"; //indirilecek dosayanın adı
header('Content-Disposition: attachment;filename='.$dosya_adi.'');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$dosya);curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_setopt($ch, CURLOPT_REFERER,"http://www.google.com");
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
curl_exec($ch);
curl_close($ch);
echo rand(0,9);die;
}
?>
Merhaba teşekkür ederim hocam size ancak denediyseniz eğer sayfaya yazdıırıyor indirme sayfası çıkmıyor.
if($_GET['git'] == 'dosya') {
$veri = $_GET['veri'];
$tip = $_GET['tip'];
//} bu fazlalık:)
header('Content-type: '.$tip.'');
echo $veri;
exit();
}hocam bunu da denedim denemeye devam ediyorum mantıklı geldi devam edecegim bna teşekkürler