I want the user to be able to download .docx
documents from a website. The file exists and path is correct because file exists is returning true, but in the view, browser says FileNotFoundException
.
If I copy the error path and past into explorer address box, it opens the document.
public IActionResult DownloadDocument(int docID)
{
if (System.IO.File.Exists(@"C:\Users\Folder1\source\repos\Folder2\Folder3\Contents\Folder4\CustomerFeedback.docx"))
return File(@"C:\Users\Folder1\source\repos\Folder2\Folder3\Contents\Folder4\CustomerFeedback.docx", "application/docx", "CustomerFeedback.docx");
}