in my project i want to download a zip file directly i already did it but it has some problems, first the zip name is "ZIP.png". then before it downloads i wanted to display a window where the user confirms the download that usually appears at the moment i have this(i just have 1 zip to download)
Download
public FileResult Download(int id)
{
string contentType = "";
var arquivos = db.Anexos.ToList();
string nomeArquivo = (from arquivo in arquivos
where arquivo.AnexoId == id
select arquivo.Caminho).First();
string extensao = Path.GetExtension(nomeArquivo);
string nomeArquivoV = Path.GetFileNameWithoutExtension(nomeArquivo);
System.Diagnostics.Debug.WriteLine("~/Anexos/" + nomeArquivoV + extensao);
if (extensao.Equals(".zip"))
contentType = "application/zip";
return File(nomeArquivo, contentType,"~/Anexos/" + nomeArquivoV + extensao);
}