Code
1MemoryStream ms = new MemoryStream();
2Response.ContentType = "application/octet-stream";
3string strFileName = HttpUtility.UrlEncode("TestFileName");
4Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName + ".zip");
5
6zlib.ZOutputStream outputStream = new zlib.ZOutputStream(ms, zlib.zlibConst.Z_DEFAULT_COMPRESSION);
7
8string strInfo = "string";
9
10byte[] buffer = new byte[strInfo.Length];
11buffer = System.Text.Encoding.UTF8.GetBytes(strInfo);
12
13outputStream.Write(buffer, 0, buffer.Length);
14
15outputStream.finish();
16outputStream.Close();
17
18Response.Clear();
19Response.BinaryWrite(ms.ToArray());
20Response.End();
21
1MemoryStream ms = new MemoryStream();
2Response.ContentType = "application/octet-stream";
3string strFileName = HttpUtility.UrlEncode("TestFileName");
4Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName + ".zip");
5
6zlib.ZOutputStream outputStream = new zlib.ZOutputStream(ms, zlib.zlibConst.Z_DEFAULT_COMPRESSION);
7
8string strInfo = "string";
9
10byte[] buffer = new byte[strInfo.Length];
11buffer = System.Text.Encoding.UTF8.GetBytes(strInfo);
12
13outputStream.Write(buffer, 0, buffer.Length);
14
15outputStream.finish();
16outputStream.Close();
17
18Response.Clear();
19Response.BinaryWrite(ms.ToArray());
20Response.End();
21