So here is the problem. i am saving images in binary form to db. In the WCF service i created I want to save the file to a folder within the project i.e (/Images).
I normally use this code
//picbin is binary image data fetched from db
ImageConverter ic = new ImageConverter();
System.Drawing.Image img = (System.Drawing.Image)ic.ConvertFrom(picbin);
img.Save(HttpContext.Current.Server.MapPath(imagePath + picture_id + ".Jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg);// imagePath ="Images/"
The problem is HttpContext.Current.Server.MapPath does not work in WCF services. so how can I get the physical path to save the image. Also what Url can i Get to access the image
I tried Using HostingEnvironment.MapPath, but the path it returns is always null.