<pre> public FileResult Download(string ImageName) { var IdSes = Session["IdSes"]; string FileVirtualPath= "/Da-app01/Data/Tracker/uploads/" + IdSes +"/"+ ImageName; return File(FileVirtualPath, "application/force-download", Path.GetFileName(FileVirtualPath)); }
[DirectoryNotFoundException: Could not find a part of the path 'C:\Users\G\Desktop\application\Da-app01\Data\Tracker\uploads\33\test1.pdf'.]
Quote:Da-app01\Data\Tracker\uploads\33\test1.pdf
Quote:C:\Users\G\Desktop\application
FileVirtualPath
Da-app-01\Data\Tracker\uploads\33\test1.pdf
String path = HttpContext.Current.Server.MapPath("~/" + FileVirtualPath);
HostingEnvironment.MapPath("~/" + FileVirtualPath)
Server.MapPath("~/" + FileVirtualPath)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)