I have the following code in controller:
public ActionResult Download(string file){
...
...
if(System.IO.File.Exists(file)){
return File(File.Open(file, FileMode.Open, FileAccess.Read), contentType, newFilename);
}
return ??; //what should return here ?
}
If no file exists then stay on same page where that action was called. How to do that ?
If return null then will display a blank page.