Allen,
and then try this code :
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void ButtonDownload_Click(object sender, EventArgs e)
{
if (Uploader1.Items.Count == 0)
return;
Context.Response.Clear();
Context.Response.AddHeader("Content-Disposition", "attachment; filename=allfiles.zip");
Ionic.Utils.Zip.ZipFile file = new Ionic.Utils.Zip.ZipFile(Response.OutputStream);
foreach (AttachmentItem item in Uploader1.Items)
{
if (!item.Visible) continue;
if (!item.Checked) continue;
file.AddFileStream(item.FileName, "", item.OpenStream());
}
file.Save();
Context.Response.End();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<CuteWebUI:UploadAttachments runat="server" ID="Uploader1" />
<br />
<asp:Button runat="server" ID="ButtonDownload" Text="DownloadAll" OnClick="ButtonDownload_Click" />
</form>
</body>
</html>
Regards,
Terry