Http handler problem RRS feed

  • Question

  • User1289704068 posted

    Hi all,

    I wrote a Http Handler that catch jpg images and save them on the server.

    I have a webservice project , I added a Generic HttpHandler.

    I published the project to the web server. When I browse the web service I get a problem with the HttpHandler element I added to the web.config, has a problem with the type value.


    <add verb="*" path="*" type="ImageHandler,App_Code.dll/>


    The problem is with the type, that the server couldn't load the handler.from the assembly App_Code.

    Is It aproblem to make the handler with the webservice project. 

    Do you have any a link for handlers tgo transfer images.

    Thanks in advance... 


    Saturday, October 7, 2006 2:39 PM

All replies

  • User2032526919 posted

    You might want to specify the handler a namespace (in the code) and also give that to the <httpHandler> element (can you post code in case this doesn't help). And another thing is that you probably want to map the handler to specific file extension, not to all extensions (e.g use *.myextension instead of just *).

    And with generic handler, by the way, do you mean a handler which takes extension ashx? (as that does not need the registration)

    Sunday, October 8, 2006 12:14 PM
  • User1289704068 posted

    Thanks for your reply,

    This is the simple code I use,

    1    <!--WebHandler Language="C#" Class="ImageUploading"-->
    3    using System;
    4    using System.Web;
    6    public class ImageUploading : IHttpHandler
    7    {
    8        public void ProcessRequest(HttpContext context)
    9        {
    10           context.Response.ContentType = "text/plain";
    11           context.Response.Write("Hello World");
    12       }
    14       public bool IsReusable
    15       {
    16           get
    17           {
    18               return false;
    19           }
    20       }
    21   }
    24   The web config line are:
    26           "*" path="*.jpg" type="ImageUploading,App_Code.dll"/>
    What can be the problem. I remember I did this task in ASP.Net 1 and it worked fine. Also I tried to add a namespace and didn't help. 
    Is there any relation to permissions in the IIS. I published the project to IIS 5 server. I get also a trace error log something related to all the dll files in the temporary ASP.NET folder.
    Any suggestions please.
    Could you please create a project with a Generic HttpHandler and try it.
    Thnaks in advance.
    Sunday, October 8, 2006 11:47 PM
  • User2032526919 posted
    So is it .ashx handler? E.g simple handler? In that case no resgitration is needed.
    Sunday, October 15, 2006 5:08 AM