I need to upload a new Facebook photo.
method, which currently is not supported in the PHP Client
Library (see Adding Missing PHP Client Library Methods). Luckily,
Jeremy Blanchard, Paul Wells, and Kevin Pazirandeh have developed an unofficial extension
that supports uploading, which you’ll find at http://wiki.eyermonkey.com/Facebook_Photo_Uploads.
If you’re making API calls directly from your own code or are
using a different Client Library, this won’t be so important to you.
The syntax for their method is very similar to what’s outlined on the
Developers Wiki, with the notable exception of the
$result = $facebook->api_client->photos_upload($filename, $aid, $caption);
In this case,
filename is a
URL pointing to the image you want to add to Facebook (it has to be
somewhere on the Web already);
is the album ID you want to add the photo to; and
caption is an optional caption describing
the image. The Wiki defines this function as accepting raw data to
upload the image with, which means you could actually take a file from
the user’s local computer and upload it instead of requiring it to be
on the Web.