my complete directory path = C:\Users\abc\source\repos\SkylandApplication\WebApp\Upload\Documents\5\FranchiseData\Location\1\70054b29-20f1-438e-9c78-521a34107c9d.jpg
public ActionResult DownloadFranchiseLeftsideImg(CompanyLocationViewModel model)
{
try
{
CompanyLocationViewModel obj = Session["Location"] as CompanyLocationViewModel;
obj.LeftsideImg = model.LeftsideImg;
obj.RightsideImg = null;
obj.InsideImg = null;
obj.OutsideImg = null;
var LeftSideImg = repo_companylayoutlocation.LocationDownloads(obj);
string UploadedPath = System.Configuration.ConfigurationManager.AppSettings["ImagePath"];
string folderName = "FranchiseData/Location/" + obj.LocationId;
String absolutePath = System.Web.Hosting.HostingEnvironment.MapPath(UploadedPath + "\\" + obj.FranchiseId + "\\" + folderName);
string completePath = System.IO.Path.Combine(absolutePath, LeftSideImg);
byte[] fileBytes = System.IO.File.ReadAllBytes(completePath);
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, "LeftSideImg");
//var bytes = System.IO.File.ReadAllBytes(completePath);
//return File(completePath, MimeMapping.GetMimeMapping(completePath), LeftSideImg);
//return File(completePath, "application/force -download", LeftSideImg);
}
catch (Exception ex)
{
throw;
}