tags:

views:

116

answers:

0

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!