1

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);
    }
  • check this out http://stackoverflow.com/questions/29907291/downloading-of-zip-file-through-asp-net-mvc-using-dotnetzip – aggaton Jun 08 '16 at 18:13
  • i did it, but i dont understand what the right answer does it is kinda confusing for me since what i want is some changes on mine –  Jun 08 '16 at 18:20

0 Answers0