1

I am using the following code to share images on facebook but when the dialog box is shown it does not show the image and once it is uploaded facebook just shows a link to image.

<a name="share" type="button" href="https://www.facebook.com/sharer.php?u=www.example.com/myimage" target="_blank">share</a>
  • Possible solution: http://stackoverflow.com/questions/11005891/using-api-to-post-links-does-not-include-picture-title-or-meta-desc-php –  Jul 20 '13 at 03:26

5 Answers5

3

This should work like this

<a href="http://www.facebook.com/sharer.php?s=100&amp;p[title]=Our Site Title&amp;p[url]=http://us.oursite.com/default.aspx&amp;p[images][0]=http://www.history.malc.eu/globe.jpg&amp;p[summary]=Our facebook description that is used on the FB share page." target="_blank">
    Share this
</a>

EXAMPLE

Khawer Zeshan
  • 9,470
  • 6
  • 40
  • 63
  • 1
    I think I could not express myself clear, I mean I need to share the image not the link, something like user is sharing a photo on his/her timeline but rather than doing it directly on fb he is using my website to share the photos to his timeline. Anyway to add the photo to their timeline folder? –  Jul 15 '13 at 01:32
3

Use the Facebook debug tool to see how Facebook processes the URL you're sharing.

The Facebook scraper will look for OpenGraph meta tags. You can reference the image you want as a thumbnail with the og:image and og:image:secure_url

Alternatively, if you wanted to upload the image to Facebook so that it goes into the user's album, you should check out How-To: Use the Graph API to Upload Photos to a User's Profile

To be more clear, you should not be sharing a link directly to the image, but rather to a page which has OpenGraph meta tags, one of which should link to the image.

rcambrj
  • 592
  • 3
  • 8
1

Facebook doesn't support sharing of plain images, only hyperlinks can be shared. Try posting the same image's link on your profile as status. Facebook won't show you any thumbnail for it but just the link. To share a image on facebook, you have to somehow upload it -_-

UsmanAzam
  • 539
  • 4
  • 15
0

From the social plugins docs the share initiates a callback from Facebook to the page you want to share. To affect what that shows you would have a page with meta tags (og:image, og:title and og:description) to affect what Facebook puts in the comment on the users timeline.

To show the image, you'd probably need a hosting 'page' that uses a thumbnail of your image in its meta data so that it appears in the users timeline correctly.

Facebook then polls this periodically. This is very similar to the like mechanism.

Simon
  • 984
  • 1
  • 8
  • 24
  • It is about sharing an image not a page or website. –  Jul 15 '13 at 23:24
  • Yes - but as the other posts say you should share a page that hosts the image so you get the advantage of the open graph meta tags. YMMV – Simon Jul 17 '13 at 09:40
0

Make sure you use dont click on share more than once, after that you cant see additional changed you made for next 24 hours

Digis
  • 70
  • 1
  • 8