ASP.NET Httphandler and file names with ampersand = 404 Error. Please help.

  • Thread starter Prasanna Padmanabhan
  • Start date
P

Prasanna Padmanabhan

I want to process requests to certain image files that have a custom
..icon(32x32) extenstion with a custom .NET HttpHandler in order to be able
to tap into Application events. This works fine almost everytime except that
I get a 404 error when trying to access a file with an ampersand in its
name. The error happens only if I point the aspnet_isapi.dll to the .NET
Framework 1.1. If I use the aspnet_isapi.dll of the old .NET framework
(1.0), I get no errors. Do you have any ideas?

Here is what I am doing:

1. I have a class implementing IHttpHandler interface. The ProcessRequest()
method simply writes the .icon(16x16) file to the virtual directory and the
subsequent HTTP request for the icon gets the file from the virtual
directory.

2. Web.config file contains this entry:
<httpHandlers>
<add verb="GET,HEAD,POST,DEBUG" path="*.icon(32x32)"
type="MyHandler, MyAssemblyName" />
</httpHandlers>

3. There is the mapping of the ".icon(32x32)" file extension to .NET
Framework aspnet_isapi.dll with the verbs "GET,HEAD,POST,DEBUG" in my web
application directory.

I am running IIS 5.0 and .NET Framework 1.1. As I said, using the old .NET
Framework in my ISAPI mappings
(C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll), I have
absolutely no problems. Did MS change something? Maybe some new security
restrictions that is causing this to happen??


Thanks,
Prasanna
 
K

Kevin Spencer

The ampersand character is a URL character for separating the URL from the
QueryString. IOW, if you request, for example:

http://www.yoursite.com/foo&bar.icon

The web server will identify the ampersand as the end of the URL and the
beginning of the query string.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top