I am trying to create an application where the user can browse and submit a photo from their computer onto their facebook. For this, they will first have to upload their photo o
Assuming that the user has correctly uploaded the image and $location.$name
is the path:
$request = new FacebookRequest(
$session,
'POST',
'/me/photos',
array (
'source' => file_get_contents($location.$name),
)
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
Or another possibility is via URL:
$request = new FacebookRequest(
$session,
'POST',
'/me/photos',
array (
'url' => $the_url_to_the_image,
)
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
And the API call you do AFTER the upload is done by the user but that is not more than logical.