Hello,
Until now I am using the following code to loading a XML file and
sending as a ashx page response. (I do this for security reasons)
But now I want to send a ZIP file (or any other binary file) instead the XML file.
How can I do this?
what time of stream I need to use, and how?
public class XmlBackupHandler : IHttpHandler
{
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext ctx)
{
XmlDocument xmlBackup = new XmlDocument();
xmlBackup.Load(HttpContext.Current.Server.MapPath("~/temp/file.xml"));
ctx.Response.ContentType = "text/xml"; // may bee "application/x-zip-compressed" ?
xmlBackup.Save(ctx.Response.OutputStream);
}
}
Thanks you very much,
Edu