Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have image in database and i use base64 to display it but when i open inspect i get this value

HTML
<img src="data:image/png:base64,/9i/fsdkjflkefnslngfdlmfg />


but i want display it like this

HTML
<img src="URL FOR IMAGE " />


this is my code in View:-

HTML
<img class="img-responsive" src="data:image/png;base64,@Convert.ToBase64String(Model.imgslide[i].prod_img_data, 0, Model.imgslide[i].prod_img_data.Length)" alt="@Model.imgslide[i].alternate_text">


What I have tried:

Can any one help me to solve this problem ?
Posted
Updated 18-Sep-17 22:30pm
v2

1 solution

You would need to set up a Web API[^] endpoint for images with the images stored in bytes. Something like this: c# - Return image url as result of web api 2 query - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900