Page 1 of 1

Photo Sharing Facebook/Twitter etc.

Posted: Mon Jun 02, 2014 6:04 pm
by Bill Clanton

Hello, i have a photo sharing app, much like instagram. so far the system has been working fantastic for our vision of the app. However, the last part i need to finish is the ability for a user to share a photo on facebook. I am storing the photos in a collection called "photos" as base64 images.

How do I easily make those photos able to be shared on Facebook and or Twitter. The photos will need to be public so that non-users of the app can view them.

In addition we'd need this same method for displaying galleries on our website.

I've tried looking over the database tutorial about directly linking to files, but these photos are not in the "files" collection.

Any advice is greatly appreciated.

thank you,


Photo Sharing Facebook/Twitter etc.

Posted: Mon Jun 02, 2014 8:13 pm
by Kateryna Grynko

Hi Bill,

You can save them to files using the function codeatob()/code:
https://developer.mozilla.org/en-US/d...

Use the following Database query:precodecurl -X POST \
-H "X-Appery-Database-Id: 516fb7c3e4b0e0d8f16ccf9a" \
-H "X-Appery-Session-Token: <session_token>" \
-H "Content-Type: <content_type>" \
--data-binary '<file_content>' \
https:&#47;&#47;api&#46;appery&#46;io/rest/1/db/files/<file_name>/code/pre


Photo Sharing Facebook/Twitter etc.

Posted: Tue Jun 03, 2014 2:13 pm
by Bill Clanton

should the atob() functions work by default? or is there a library i need to add?

is there an easier way to share photos on facebook? or is this the only way.

I'm guessing that i'm answering my own question, but i think in order to share to facebook i'll need a direct url to the jpg, etc. So perhaps not.


Photo Sharing Facebook/Twitter etc.

Posted: Wed Jun 04, 2014 12:53 am
by Bill Clanton

just and update so far i've been able to get this to work sharing to Facebook using a bit of javascript that i found that will decode the image and then post an html5 canvas to facebook. so far it's working. next step is to find a Twitter and Pinterest solution to do the same thing.

thanks for the help.


Photo Sharing Facebook/Twitter etc.

Posted: Wed Jun 04, 2014 3:07 pm
by Evgene Karachevtsev

Hello Bill,

Thank you for your update. Could you please clarify, do you need any help?


Photo Sharing Facebook/Twitter etc.

Posted: Wed Jun 04, 2014 6:49 pm
by Bill Clanton

you can close this ticket. i was able to use the code I had for facebook and then i whipped up a script in php to grab the base64 and save it as a jpg, and then with that i could post that to pinterest. it took quite a few steps, but in the end i have all of my sharing buttons working now.

thank you again.


Photo Sharing Facebook/Twitter etc.

Posted: Wed Aug 20, 2014 4:43 am
by Anil Sagar

Hi Bill, could you pls share your solution for sharing pics on FB? I am trying to use like/share button iFrame code given by FB for developers. I am not able to change that code to share a pic or custom text.

I have tried using html code given by FB for like/share button but since I am trying to setup those buttons for all of my products (fetched from a DB array dynamically), I am suggested by Appery support team to use iFrame.

If you can share your solution, I can try to relate. Thanks.


Photo Sharing Facebook/Twitter etc.

Posted: Thu Aug 21, 2014 4:15 am
by Yurii Orishchuk

Hi Anil,

Here is our answer for this question: https://getsatisfaction.com/apperyio/...

But it would be great if Bill will help you more..

Regards.