I've written an HttpHandler that works fine when I test it on the ASP.NET development server.
In my Web.Config I have:
<add verb="*" path="Files.zip" type="MyNamespace.Zip, App_Code" />
And in my Handler in my App_Code folder I have the code below. Unfortunately, since the ASP.NET development server dumps everthing in the root -- http://localhost:1234/Files.zip works just fine. However, I'm trying to deploy to an intranet server where the the URL is something like http://myProjects/project. When I point my browser to http://myProjects/project/Files.zip I get a 404. How can I tweak the web config to get the right path? Or is the solution somewhere else? I've already tried prefixing the path with "~/" and "./".
(Namespace MyNamespace, file Zip.cs)
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "application/octet-stream";
DirectoryInfo di = new DirectoryInfo(context.Server.MapPath("files"));
FileInfo[] fileinf = di.GetFiles();
ZipFile zip = new ZipFile();
foreach(FileInfo fi in fileinf)
{
zip.AddFile(fi.FullName, "");
}
zip.Save(context.Response.OutputStream);
}