0

I have a project that saves files into /TUploads, then i made a virtual directory path named /TUploadFolder that pointing to the /Uploads folder. I want to get the file that is stored in the /Tuploads folder via /Tuploadfolder folder, currently my getfile code is like this.

var path = Path.Combine("TUploadFolder" , "filename.pdf"); 
var bytes = await System.IO.File.ReadAllBytesAsync(path);
return File(bytes, contentType, Path.GetFileName(path));

But it seems like i get the error of "could not find a path to e:/folderProject/TUploadFolder/filename.pdf, but when i tried to access e:/folderProject/TUploads/filename.pdf it works fine.

this is what my web look like in iis enter image description here

is there any way to access the physical path via virtual directory path?

stucknubie
  • 23
  • 4

0 Answers0