I have a couple of functions... one (the one that is working) oploads a file to a local project folder... the code looks like this
Now this works fine. I am assuming that it is pointing to the correct folder due to the method of request.physicalapplicationpath... it then uses that call to point to where to write the file to. I then have another function to delete files from that folder
string fileDirectory = @"/Files/";
string FilePath = Request.PhysicalApplicationPath;
string fileName = txt_fileName.Text + ".html" ;
string SaveFilePath = FilePath + fileDirectory + Server.HtmlEncode(fileName);
now when i try this i get an error
string filepaths = Directory.GetFiles(@"/Files/");
foreach (string filepath in filepaths)
now this to me is obvious, i am calling the directory in directory.getfiles...
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Files\'.
but i cannot figure out how to set my directory path relative to my application path...
IE how do i do something similar to request.physicalapplicationpath and apply it to my delete call... I've tried various methods but i get error after error...