public ActionResult Descargar(string path) { //Recuperar path path = path.Replace("~", "/"); int cifradoValue = Int16.Parse(HttpContext.Request.Cookies["cifrado"].Value); //Descifrar SDES cipher = new SDES(); string rutaCifrado = cipher.DescifrarArchivo(path, Directories.directorioTemporal, cifradoValue); //Descomprimir string rutaComprimido = LZW.descomprimirArchivo(rutaCifrado, Directories.directorioDescargas); //Descargar if (!String.IsNullOrEmpty(rutaComprimido)) { byte[] filedata = System.IO.File.ReadAllBytes(rutaComprimido); var cd = new System.Net.Mime.ContentDisposition { FileName = Path.GetFileName(rutaComprimido), Inline = true, }; Response.AppendHeader("Content-Disposition", cd.ToString()); return(File(filedata, "application/force-download")); } else { return(RedirectToAction("Index")); } }