I have .html file and gif file which are stored on Server's machine in one folder. Html file has a reference on gif file like <img src="file.gif" />.
In my ASP.NET MVC Application I would like to show "Download" link. If user clicks on it browser has to show stored html file with injected picture.
I tried to use next code:
@Html.ActionLink("Download", "DownloadHtmlFile", "ControllerName")
public ActionResult DownloadHtmlFile()
{
return new FilePathResult("path_to_html_file.html", "text/html");
}
In that case browser shows html file. But there is hole into image place instead of image (like it was removed).
How can I implement that correctly?
P.S. I can't store files in my application's folder (like 'C:\inetpub\MyApplicationName...') in order to put direct reference on them into .cshtml View cause it gives unauthorized access to them.