httpHandlers problem

G

Guest

Hi;

We return files that are stored in our database using an httpHandler as
follows:
<httpHandlers>
<add verb="*" path="report-view.*" type="ReportView"/>
</httpHandlers>

Now as I understand it, we can make the path "filename.*" and we can make it
"abc*.*". But we cannot make it "files\*" or "files\*.rtf".

Here is the problem we are facing. The number 1 complaint we are getting
about our portal is that if the file up there is dave.rtf, they want the link
to be dave.rtf. It can be url/files/dave.rtf - the directories part can be
anything. But the filename part must be dave.rtf.

How can we set this up so any requests to "url/files/*" or "url/files/*.rtf"
goes to our http handler? We desperately need this capability. TIA.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hi Dave,

According to your httphandler, are you just wantting to let it intercept
all those requests with the *.rtf format regardless of the path hierarchy
in your web application, correct? For example, you want the handler be able
to intercept all the paths below:

/appliation/report.rtf
/application/subdir/report.rtf
/application/subdir/subdir/report.rtf
..........

If so, the following path setting is enough:

<httpHandlers>
<add verb="*" type="MyRtfHandler" path="*.rtf" />
.............


And you can intercept those *.rtf requests in all the directory hierarchy
(as long as it is under your application's root dir). If you want further
filtering, you can do it in the httphandler's code manually.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Sorry, no - I wasn't clear enough. What I want is:
/application/subdir/report.rtf

But it cannot handle:
/application/report.rtf

because one of the extensions we handle is .htm and we can't have all .htm
files go through our handler. .pdf is another and we do have a couple of
static pdf files in our site.

So what I need is
/application/subdir/*.rtf
and
/application/subdir/subdir/*.rtf
is ok - don't care either way on that one.


How can I do that?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Thanks for your reply.

Based on your further explanation, I understand that you only want your
custom httphandler to intercept and process those "*.rtf" requests under a
particular sub directory path, correct?

If this is the case, I think you can consider the following means:

Do not add the custom httphandler mapping in your application's root
web.config file. Create a sub directory (suppose named "subdir" ) ini your
application directory and put a sub web.config in it and put the custom
httphandler mapping in this sub web.config file .e.g.

App Root/
subdir/
web.config

=========web.config============

<configuration>
<appSettings/>
<connectionStrings/>
<system.web>

<httpHandlers>
<add verb="*" type="MyRtfHandler" path="*.rtf" />
</httpHandlers>
</system.web>
</configuration>
===============

Thus, only url with "rtf" extension and are under that "subdir" will be
processed by your custom handler.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

You're welcome ;-)

Good luck!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top