0
I am developing an ASP.NET MVC project using c#.
I have a page with a facebook share button.
The sharing button is already working, however I’m having problems because of the image tag, because it only accepts hyperlink images.
The image I want to show is in the database and is in string format(Base64).
OpenGraphProperties.AddImage("http://odishasuntimes.com/wp-content/uploads/2017/04/asteroid.jpg");
This is the method that will allow you to create the og:image tag. This method is working correctly because I gave you the link of a random image I found on the net.
However if I pass you a string of an image I have stored in the comic book it won’t work. If I go to the facebook debug page I can notice this because there shows me an error that says og:image tag was created incorrectly.
What I want is a way to create a link to an image I have stored in the BD similar to the link above.
One thing I noticed is that if the image is stored in the Project root, instead of being in the BD, for example, in a content/images folder the og:image tag already works.
Thus:
OpenGraphProperties.AddImage(Url.Content("~/Content/Imagens/User.png"));
How do I create a hyperlink of the image that is stored in the database ?
Romeu shares with us what you have tried in code form and more information from the base to understand where the image is stored (table, column) which database ...
– Caique Romero