I'm using MVC with Web Api. I'm saving my image Path to DB. this is code I have written in web Api.

public int AddToolItem(ToolItem toolItem, HttpPostedFileBase toolItemImage)
            var fileName = Path.GetFileName(toolItemImage.FileName);
            var path = Path.Combine(HttpContext.Current.Server.MapPath("~/Upload/ItemImage/"), fileName);
            toolItem.ToolItemImage = path;

            return dbContext.SaveChanges();

It save the physical path of image


But when I'm retrieving, and Displaying in my mvc view page, Image is not showing .

<img src="@toolItem.ToolItemImage" /> 

It rendering the image as

<img src="E:\lifeexpress\rar\LifeExp\LifeExp\LifeExp.Web\Upload\ItemImage\images.jpg">

How can I show the image.

Related posts

Recent Viewed