Разобрался.Вот решение:
$graph_url = "https://graph.facebook.com/". $album_id
. "/photos?access_token=" . $_POST['accesstoken'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $graph_url);
curl_setopt($ch, CURLOPT_POST, true);
// same as <input type="file" name="source">
$post = array(
"source"=>"@".$_FILES['source']['tmp_name'],
"message"=>$_POST['meessage']
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
}
?>