Sunday 15 July 2012

Allow facebook to grab Amazon S3 image -


I have an Amazon S3 account that I use to save images. I save images as private so that only my website can use S3 APIs. However, my website has a function that updates the post.

  FB.api ('/ me / feed', 'post', {link: PAGEURL, picture: PICTUREURL, name: TITLE, Description: DESCRIPTION}, function (response) {}) ;   

For this, I need the PICTUREURL So my question is how can I make the S3 bucket available to Facebook only?

I suspect that you can do this is only available on Facebook and even if you can, I do not think this picture will be visible to visitors. But it goes anywhere.

To make a photo appear on Facebook, use an expired, pre-signed URL. Instead of sending a regular S3 URL for the PICTUREURL parameter, create a URL that expires in a few minutes (long enough for Facebook to take a picture) and use it I'm not sure which language or s 3 are using the library, but they all support the creation of such pre-signed URLs.

The bad news is that this can not be helped because this is probably because Facebook can use the URL you give instead to copy the picture and display your copy to display the image. We do. If so, the end-end users will be using the URL you gave to Facebook, and it is going to end before watching it.

Of course, you can use the URL that ends in the future, but if you do this, you can make the S3 object public at the first place.

No comments:

Post a Comment