My problem: when the user clicks the image button on the aspx page, codebehind creates a zip file, and then I try to transfer this zip file to the user.
To transfer the file, I use the following code:
FileInfo toDownload = new FileInfo(fullFileName);
if (toDownload.Exists)
{
Response.Clear();
Response.ContentType = "application/zip";
Response.AppendHeader("Content-Disposition", "attachment;filename=" +
toDownload.Name);
Response.AppendHeader("Content-Length", toDownload.Length.ToString());
Response.TransmitFile(fullFileName);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
When I try to accomplish this, I get the following error on the page:
Sys.WebForms.PageRequestManagerParserErrorException: A message received from the server cannot be parsed. Common causes of this error are changes in response to Response.Write () calls, response filters, HttpModules, or server tracing. Details: parsing error next to "PK ...".
PK - zip , zip , , zip . , , / zip , , .
?
EDIT: , .