Upload photo to facebook using Rest API - php

Can you please have a look to this URL
http://developers.facebook.com/docs/reference/rest/photos.upload/
I need to have a working example, how can I use this api to upload a photo to my facebook profile.
Actually I have a php site from where I want to allow users to upload photo to their facebook profile.
Thank you

The link you posted refers to an outdated approach to FB API. It's better to use the Graph API in conjunction with the latest PHP SDK.
http://developers.facebook.com/docs/reference/api/
https://github.com/facebook/php-sdk
here's a reference to the photo object methods
http://developers.facebook.com/docs/reference/api/photo/
Here's a fairly recent example from the facebook developers blog:
http://developers.facebook.com/blog/post/498/

Related

Like Page Photo From Website PHP SDK 5.0

Was wondering if its possible to like a page post photo on Facebook from a website using the PHP SDK version 5?
I have managed to authenticate a user using the SDK but having troubles finding out if this is possible.
Any examples would be appreciated (if its possible).
Thanks.
No, it is not. Not in the name of the app user.
Facebook has recently removed the possibility to like Facebook objects such as posts, photos and comments via API in the name of a user.
https://developers.facebook.com/docs/apps/changelog#nov-17th--2016

Using PHP Facebook SDK without permissions

It's possible to use the new Facebook PHP SDK without asking the user for permissions?
I just want to show some photo albums from a public page.
Well, if the page is public, and the photo albums are public too, you should be able to get them with the Facebook API.
Have a look at the Facebook API documentation for more informations.
Here's a small example of what you could get on the FacebookDevelopers page, for example : https://developers.facebook.com/tools/explorer?method=GET&path=FacebookDevelopers%2Falbums&version=v2.0

Facebook Graph API with PHP connection

i want to display facebook friends on my website and i want to use facebook graph api for that,
please
Thanks
Prakash
Facebook Graph API with PHP connection
This tutorial might help: Facebook PHP SDK
It includes example as well.
Generate an access token for yourself by going to https://developers.facebook.com/tools/explorer and then you may be able to retrieve your friends by accessing https://graph.facebook.com/_YOUR_USER_ID_/friends?access_token=xx and then the profile images can be retrieved using the following graph API call - https://graph.facebook.com/_FRIEND_PROFILE_ID_/picture?type=square
Of course, for more details, the Facebook Documentation (https://developers.facebook.com/docs/) is where you go to.

Facebook API - webcam FBML

What is the FBML tag or any other option (I mean in API) to take photo from a webcam in Facebook (and next upload it to my profile)? I can see such an option in my profile, but I don't know how to use it in Facebook app.
There is no such option (as far as I know). In any case FBML will be deprecated on June 6, 2012. You will have to look into the video API https://developers.facebook.com/docs/reference/api/user/#videos.
There are examples on the Facebook Developers' blog of how to achieve this
Using the Graph API to upload Video
Uploading Videos to an Application, Group, or Page via the Graph API

Change Facebook profile image via API

Is it possible to change someone's profile picture via the Facebook API?
The Graph API discusses POSTing a picture to an account but I see nothing related to the direct altering of a user account. I suspect they only recognize GET requests under their RESTful API (for the user area). Thus, a no.
That's just information gleaned from the Facebook API docs, however. I could be missing something though.
not possible: Facebook API/PHP - Is it possible to change a user's profile image via FB Graph API?, and also my own experience.
This feature is not possible, period. Although you can upload an image to the Graph API and then redirect the user to the permalink of that post :)
It's possible by adding makeprofile=1 at the end of uploaded photo url. You can find example (PHP) and demo here: http://4rapiddev.com/facebook-graph-api/php-change-facebook-profile-picture-with-graph-api/

Categories