views:

539

answers:

3

I have an HttpModule that displays images that follow a certain URL pattern. For example, /images/employees/jason.jpg is handled by the module, but all other images aren't. It works just fine on my local machine (Cassini and IIS 7). However, the IIS6 production server isn't working. I've had the hosting company map the images to the ASP.NET worker process. Now, all images are showing that they can't render except for the images that should be rendered by the module. They are working correct.

I ran an HttpWatch instance on one of the files and received the following error:

ERROR_HTTP_INVALID_SERVER_RESPONSE

Any ideas?

A: 

There's doesn't seem to be anything particularly wrong with your module, so the issue must be coming from somewhere else. Have you got security that might be blocking the images? What actually gets returned when you request a static file?

I'd suggest seeing what gets returned (and its headers) using something like firebug to check things like the response code, content type, the actual raw response, etc...

Alconja
A: 

check your web.config IIS6 / IIS7 have different places to add modules and depends on what mode your IIS7 is running in.

http://arcware.net/use-a-single-web-config-for-iis6-and-iis7

Chad Grant
It is IIS6 and I did check that already.
Jason N. Gaylord
+1  A: 

Final Answer:

  1. The module needed to be updated to transmit server files. So, I added an else to my original if and checked to see if it was an image type (by using a utility method) then use Response.TransmitFile() to pass on the file to the browser.

  2. I then ran into a spacing issue with the images. This was because I forgot that I had .aspx files registered as an image type to perform the testing. So each page would crash during the debug process or add padding that was established from CSS. Doh!

Everything is just peachy now. Thanks to all!

Jason N. Gaylord