When I try to copy a file to a new destination, I get the error;
An exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll but was not handled in user code
Additional information: Could not find a part of the path '~/Content/fileHistory/Resume.pdf'.
However the file is there.
Here is my code, the fileName is found correctly;
Random randNums = new Random();
string fileName = documentUps.Attachment ;
string newFileName = fileName + randNums;
string sourcePath = "~/Content/fileHistory/";
string targetPath = "~/Content/reviseFiles/";
// Use Path class to manipulate file and directory paths.
string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
string destFile = System.IO.Path.Combine(targetPath, newFileName);
System.IO.File.Copy(sourceFile, destFile, true);