public ActionResult Delete(string id)
{
//var deleteSuccess = false;
if (string.IsNullOrWhiteSpace(id))
{
TempData["Message"] = "Unable to delete file. No file was selected. Please select a file and try again.";
return RedirectToAction("Index");
}
var fullPath = GetNamedFile(id).FilePath;
var file = new FileInfo(fullPath);
if (file.Exists)
{
file.Delete();
//deleteSuccess = true;
}
Message = String.Format("File \"{0}\" has been deleted.", file.Name);
return RedirectToAction("Index");
}