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 questionI'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));
精彩评论