I am trying to download a file stored in a folder.
string path = "D:\\app_data\\Clients\\Client " + jobdescription.ClientID + "\\Job " + jobdescription.JobDescriptionID + "\\";
string file = Path.Combine(path, jobdescription.JobTitle + ".docx");
return File(path, "application/docx", jobdescription.JobTitle + ".docx");
The error generated is:
Server Error in '/' Application.
Could not find a part of the path 'D:\app_data\Clients\Client 1\Job 2\'
But the file with specified filename is in the folder. What am i doing wrong ?
You use
pathinstead of usingfile, in your third line.It should read: