开发者

upload photos to facebook using the API [closed]

开发者 https://www.devze.com 2023-04-04 02:27 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it开发者_StackOverflow中文版 can be answered with facts and citations.

Closed 5 years ago.

Improve this question

I'm looking for an example code/article in PHP or .net how upload and mark upload photos to facebook using API. it's possible?

if can't with API, how I do this?


try this

  $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));
0

精彩评论

暂无评论...
验证码 换一张
取 消