Is there any way that I can post photos using my username and password in my Facebook profile? The code can be in PHP or Java. Can I use Facebook JAVA API, if yes? I do not want to create a Facebook app and do not allow it to post photos in my profile.
Any help is greatly appreciated. thank you in advanced.
There are a few different ways to upload photos using the PHP graph API. Examples assume that you have instantiated the $ Facebook object and there is a valid session for the current user.
1 - Current user's default app album
This example will upload the photo The current user's own default app album, if the album is not yet, it will be made.
$ args = array ('message' = & gt; 'photo caption'); $ Argens ['image'] = '@' realpath ($ FILE_PATH); $ Data = $ facebook-> API ('/ mi / photo', 'post', $ args); Print_r ($ data);
2 - Goal album
This example will upload photos to a specific album.
$ args = array ('message' = & Gt; 'photo caption'); $ Argens ['image'] = '@' realpath ($ FILE_PATH); $ Data = $ facebook-> API ('/'. $ ALBUM_ID. '/ Photo', 'post', $ args); Print_r ($ data);
3 - Target album with access token
This example will upload a photo for a specific album that requires access token.
$ Args = array ('message' = & gt; 'photo caption'); $ Argens ['image'] = '@' realpath ($ FILE_PATH); $ Data = $ facebook-> API ('/'. $ ALBUM_ID. '/ Photos? Access_token ='. $ ACCESS_TOKEN, 'Post', $ args); Print_r ($ data);
Comments
Post a Comment