M
MWells
I'm having an issue getting my HttpHandlers and HttpModules to play together
nicely.
My HttpHandlers take special document types (defined by extension) and
process them specially. I might have an HttpHandler installed to render
Excel files as HTML, or to render TIFFs to JPEGs, etc.
The HttpModules are used for Uri handling, so that a request for a resource
like;
http://somesite.com/file/sales_data.xls
....gets converted to something internally meaningful, like a database query
or a retrieval action from a third-party content management system.
Unfortunately with the HttpModule installed, the HttpHandlers never run; so
even with an HttpHandler registered to handle the ".xls" file type, the raw
Excel file is returned to the client rather than the HttpHandler-generated
content.
Is there something that I need to do in the HttpHandler to ensure that the
normal chain of processing continues? Or could Uri-rewriting be confusing
the situation, such that a conversion of;
http://somesite.com/file/sales_data.xls
....to...
http://somesite.com/getfile.aspx?FileID=103
....would prevent the matchup of the request to the defined HttpHandlers?
My best guess is that I'm doing something incorrectly in the HttpModule
that's gumming up the works, so to speak.
If not, I'm fine with invoking the HttpHandlers directly if needed. I
assume that I can read the Web.config file, determine which handler applies
based on the file extension, and invoke the handler... but in this approach
I'm uncertain how to mimic the webserver's call to the handler.
I'd greatly appreciate some advice on either approach.
/// Michael Wells
nicely.
My HttpHandlers take special document types (defined by extension) and
process them specially. I might have an HttpHandler installed to render
Excel files as HTML, or to render TIFFs to JPEGs, etc.
The HttpModules are used for Uri handling, so that a request for a resource
like;
http://somesite.com/file/sales_data.xls
....gets converted to something internally meaningful, like a database query
or a retrieval action from a third-party content management system.
Unfortunately with the HttpModule installed, the HttpHandlers never run; so
even with an HttpHandler registered to handle the ".xls" file type, the raw
Excel file is returned to the client rather than the HttpHandler-generated
content.
Is there something that I need to do in the HttpHandler to ensure that the
normal chain of processing continues? Or could Uri-rewriting be confusing
the situation, such that a conversion of;
http://somesite.com/file/sales_data.xls
....to...
http://somesite.com/getfile.aspx?FileID=103
....would prevent the matchup of the request to the defined HttpHandlers?
My best guess is that I'm doing something incorrectly in the HttpModule
that's gumming up the works, so to speak.
If not, I'm fine with invoking the HttpHandlers directly if needed. I
assume that I can read the Web.config file, determine which handler applies
based on the file extension, and invoke the handler... but in this approach
I'm uncertain how to mimic the webserver's call to the handler.
I'd greatly appreciate some advice on either approach.
/// Michael Wells