I am utilizing a controller to return a file in the following manner:
byte[] fileBytes=System.IO.File.ReadAllBytes(Path.Combine(Server.MapPath("~/Images/"), photoPath));
string fileName = prop;
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
To display this file as an HTML image, I use the code below:
<div class="col-md-6"><img src="@("File/Download?id="+ Model.ID+"&prop=photo")" alt="Image" /></div>
My goal is to create a clickable link using the same controller. When the user clicks on it, the image should be displayed like so:
<div class="col-md-4"><a @(Model.path == null ? Html.ActionLink("click here", "Download", "File", new { appid = Model.ID.ToString(), prop = "photo" }, null) : Html.ActionLink("none", "", ""))</a></div>