I am attempting to download a file from another IIS site on my local machine. I have my main website that is trying to download from another public site that contains a few files that the user will be able to download.
[HttpGet]
public ActionResult DownloadMyPrintManagerInstaller()
{
bool success;
try
{
using (var client = new WebClient())
{
client.DownloadFile(new Uri("http://localhost:182//MyPrintInstaller.exe"), "MyPrintManager.exe");
}
success = true;
}
catch (Exception)
{
success = false;
}
return Json(new { Success = success }, JsonRequestBehavior.AllowGet);
}
For some reason, it is attempting to download the file from C:\windows\system32\inetsrv\MyPrintManager.exe
? Does anyone know how I can avoid it from pointing to that directory? Do I need to modify my code or my IIS configuration?
My virtual directory for this site is a folder sitting on my C: drive, and the file I actually want to download is in that directory.