Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

save, upload, display photos with asp.net mvc core

$
0
0

Greetings,

I am trying to save, upload photos to sql db using asp.net mvc core. I think I was able to upload the photo correctly because it states binary data in sql table.

While coding out the display part it just shows a x where the photo is. Here is the code i used to display the image.

var base64 = Convert.ToBase64String(item.BusLogo);
var imagesrc = string.Format("data:image/png;base64,{0}", base64);

<img src='@imagesrc' style="max-width:100px;max-height:100px" />

If anyone know a way to do to this please reply.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>