0

I'm creating a wall post on a fanpage where i do specify the message, url, url name, caption, description and the photho thumb of the url in question.

I did notice that Facebook uses my img url directly. Meaning if i delete it from my server, the image on the post will disapear.

It seams that if i create a post with a custom image i will have to host it for life - other whise i will have many posts with broken images.

It is possible to tell FB to get a copy of the image in question?

Kara
  • 6,115
  • 16
  • 50
  • 57
David Gatti
  • 3,576
  • 3
  • 33
  • 64

3 Answers3

1

I had the same problem few weeks ago - and unfortunately there is no way to use picture hosted on FB servers. I tried giving URL of user's photo, etc - nothing works until you host it externally.

So either "host it for life" on your server, or use Flick or other similar image-hosting servers.

avs099
  • 10,937
  • 6
  • 60
  • 110
1

Not sure if this is what you want, but if you actually post the image to FB, then FB is hosting it. You can see the different post types here:

https://developers.facebook.com/docs/reference/api/page/#post_types

We chose "photos" because "links" didn't show image very large.

$api_call = '' . $network['network_id'] . '/photos';  //network_id is the page id

$attachment =  array(
'access_token' => $network['network_token'],  //access token
'source' => "@" . $image['image_path'],   //must be actual path to image
'message' => $campaign['textresponse'],
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/' . $api_call);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  //to suppress the curl output
$result = curl_exec($ch);
curl_close ($ch);

echo "<br>";
return $result;  //returns the post number as json string
ssaltman
  • 3,623
  • 1
  • 18
  • 21
0

I think it is possible to upload the photos to an album in the fan-page, and then you can use uploaded image properties for you wall post message.

ganagus
  • 54
  • 2