interkolik adlı üyeden alıntı: mesajı görüntüle
merhaba arkadaslar curl ile bi sayfaya upload yapmaya calisiyorum

function post_files($url,$files) {

    $data = "file=".$files."";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
    $response = curl_exec($ch);
    return $response;
}

echo post_files("/api/hotlink","music.mp3");
olay bu nerenin apisi oldugu fazla onemli degil ancak aldigim cevap su sekilde

No input file specified.


bunlarda sayfanin api dokumanlari..
bir turlu yapamadim yardimci olabilcek varsa simdiden tesekkurler. paypal 1 $ atarim

POST 'file'=FILE.JPG => https://*****.com/api
{"status":"success","url":"http:\/\/cdn.****.com\/1329168423170.jpg"}

POST 'file'=FILE.JPG => https://*****.com/api?plain
https://****.com/file/af16b9c6375c02d94312d9f39621f471

POST 'file'=FILE.JPG => https://*****.com/api/hotlink
https://cdn.*****.com/1329168423170.jpg

Merhabalar,

Aşağıdaki verdiğim kodu denermisiniz?

function post_files($url,$files) { 

    $Veri = array('name'=>'file', 'file'=>$files); 
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 
    curl_setopt($ch, CURLOPT_POST, true); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $Veri );  
    $response = curl_exec($ch); 
    return $response; 
} 

echo post_files("/api/hotlink","music.mp3");