Set file upload support in the SDK. Your server must be configured to support file uploads in order to use this feature.
You can also set this parameter via the
fileUpload property in the
$config array when you instantiate the Facebook object.
// Upload a photo to a user’s profile // Your app needs photo_upload permission for this to work $facebook->setFileUploadSupport(true); $img = '/tmp/mypic.png'; $photo = $facebook->api( '/me/photos', 'POST', array( 'source' => '@' . $img, 'message' => 'Photo uploaded via the PHP SDK!' ) );