0
Guys I have the following code on an aspx page that compresses files and then downloads them...
protected void Page_Load(object sender, EventArgs e)
{
try
{
JuntarArquivosAprovados(startPath);
CompactarArquivos();
DeletarConteudoPasta();
FileInfo file = new FileInfo(zipPath);
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name + ";");
response.WriteFile(file.FullName);
response.Flush();
response.Close();
}
catch (Exception ex)
{
throw ex;
}
}
He downloads the compressed files right...but when I open I get the message that the files are damaged and does not open...I have another project that uses the SAME code in a Webservice (asmx) and I can open these files quiet... Does anyone have any idea why ?
And if you just compact and try to open the file on the same server, it opens normal?
– Maniero
opens normal yes
– Daniel