In my ASP.NET application, a method that is supposed to write a file to disk sometimes unexpectedly ends up writing the file with the filename NOT_A_VALID_FILESYSTEM_PATH
.
The (simplified) code is:
private void WriteFile(string fileID)
{
string fileName = Server.MapPath("/Data/" + fileID + ".xml");
// (More code that writes data to that file...)
}
Why is Server.MapPath returning the string "NOT_A_VALID_FILESYSTEM_PATH"?