2011-09-10 7 views

答えて

1

この

$file= '/path/filename.jpg'; 
    $args = array(
     'message' => 'Photo from application', 
    ); 
    $args[basename($file)] = '@' . realpath($file); 
    $ch = curl_init(); 
    $url = 'http://graph.facebook.com/'.$album_id.'/photos?access_token='.$access_token; 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_HEADER, false); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_POST, true); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $args); 
    $data = curl_exec($ch); 
    //returns the photo id 
    print_r(json_decode($data,true)); 
を試してみてください
関連する問題