473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

httpHandlers problem

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
Mar 15 '07 #1
5 1318
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Mar 16 '07 #2
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


"Steven Cheng[MSFT]" wrote:
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Mar 16 '07 #3
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/subscripti...ult.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/subscripti...t/default.aspx.

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

This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 19 '07 #4
Oh wow - this looks perfect. I am leaving for the SD West show shortly but
will try this next week when I get back. THANK YOU.

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

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


"Steven Cheng[MSFT]" wrote:
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/subscripti...ult.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/subscripti...t/default.aspx.

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

This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 19 '07 #5
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.

Mar 20 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
0
by: Chance Hopkins | last post by:
Does anyone know how to get a custom httpHandler to fire for all applications in machine.config for an assembly in the GAC, without using seperate location tags? For instance, this works for a...
1
by: Patrick Kristiansen | last post by:
Hi! I have on my website a root web.config file, and also created a subapplication "/publikationer". In my root web.config I've specified an HTTP-handler for some requests, but this is mirrored...
1
by: TJoker .NET | last post by:
I have this web control that need to process some special urls requested by the browser. So I created a class implementing IHttpHandler to deal with it. The problem here is that to properly use...
4
by: Grant Harmeyer | last post by:
How would I set up an httpHandler so that it would only apply to certain child directories of the application? I.E: <httpHandlers> <add verb="*" path="/files/*/*/*/*.aspx"...
3
by: MWells | last post by:
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...
0
by: tshad | last post by:
I have 2 controls that I need to run that I got of the Web. I have been using ScrollKeeper for awhile and was trying to add FreeTextBox to my site. But for some reason it won't run if ScrollKeeper...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
6
by: =?Utf-8?B?TWFuc28=?= | last post by:
Hi, We are doing custom request rewriting in a httpModule in Application.AuthenticateRequest for requests coming in with .aspx using HttpContext.RewritePath(). We are having a problem...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.