This is my code for Download a File in my MVC App. Im having a weird error and I cant a way to put it right. The error is > Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.FileResult'
What I want with this code is, that while theres a file download it, but if theres not file(null) then it just dont do nothing or dont return nothing
public FileResult Download(string Doc)
{
string fullPath = Path.Combine(Server.MapPath("~/UploadFiles/"), Doc);
if (fullPath == null)
{
byte[] fileBytes = System.IO.File.ReadAllBytes(fullPath);
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, Doc);
}
return RedirectToAction("List");
}