I'm developing an ASP.NET MVC project using C #.
I have a page with a share button with facebook.
The sharing button is already working, however I'm having problems because of the image tag, because it only accepts hyperlinks of images.
The image I want to display 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 passed the link to a random image that I found on the net.
However if I pass you a string from an image I have stored in the DB it will not work. If I go to the facebook debug page I can see it because there shows me an error that says the og: image tag was created incorrectly.
What I want is a way to create a link to an image I have stored in the DB 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 DB, for example, in a content / images folder the og: image tag already works.
So:
OpenGraphProperties.AddImage(Url.Content("~/Content/Imagens/User.png"));
How do I create a hyperlink of the image that is stored in the database?