Uploading a picture to a album using the graph api

Posted by kielie on Stack Overflow See other posts from Stack Overflow or by kielie
Published on 2010-06-10T13:55:59Z Indexed on 2010/06/14 22:02 UTC
Read the original article Hit count: 310

Filed under:
|
|

Hi guys, I am trying to upload an image to a album, but it's not working, here is the code I am using,

$uid = $facebook->getUser();

$args = array('message' => $uid);

$file_path = "http://www.site.com/path/to/file.jpg";
$album_id = '1234';

$args['name'] = '@' . realpath($file_path);

$data = $facebook->api('/'. $album_id . '/photos', 'post', $args);
print_r($data);

This code is in a function.php file that gets called when a user clicks on a button inside of a flash file that is embedded on my canvas, so basically what I want it to do is, when the flash takes a screen shot and passes the variable "image" to the function, it should upload $_GET['image'] to the album.

How could I go about doing this?

Thanx in advance!

© Stack Overflow or respective owner

Related posts about php

Related posts about facebook