473,947 Members | 4,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set IHttpHandler for all files in a directory?

Hi;

I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapVie w"/>
and
<add verb="*" path="html-image\*" type="BitmapVie w"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.

If I set
<add verb="*" path="html-image.*" type="BitmapVie w"/>
That works - but it is not what I need.

Any ideas?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Oct 2 '06 #1
6 1686
q
In IIS, there is a wildcard application map. Do that on your virtual
directory. Then, you should be a step closer to what you want...

David Thielen wrote:
Hi;

I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapVie w"/>
and
<add verb="*" path="html-image\*" type="BitmapVie w"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.

If I set
<add verb="*" path="html-image.*" type="BitmapVie w"/>
That works - but it is not what I need.

Any ideas?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Oct 3 '06 #2
q
Er... and if the file isn't real make sure you turn OFF file existence
verification in IIS for the mapping.

David Thielen wrote:
Hi;

I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapVie w"/>
and
<add verb="*" path="html-image\*" type="BitmapVie w"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.

If I set
<add verb="*" path="html-image.*" type="BitmapVie w"/>
That works - but it is not what I need.

Any ideas?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Oct 3 '06 #3
Hello Dave,

As for the httphandler configuration, as far as I knew, it supports limited
wildcard mapping format. So far based on my test, as long as you've
configured the IIS extension mapping to redirect the certain document
extension to ASP.NET isapi.dll, the following wildcard format httphandler
path is supported:

<add path="test.*" verb="*" type="PPTHandle r, __code"/>

<add path="*.test" verb="*" type="PPTHandle r, __code"/>

<add path="*asm.bsd" verb="*" type="PPTHandle r, __code"></add>

<add path="asm*.bsd" verb="*" type="PPTHandle r, __code"/>

As for the test path you provided, why did you put an "\" char in the path,
is it necessary for your application?
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 3 '06 #4
I have to return bitmaps that I have stored in a database. So my plan was
that the filenames woul be html-file\1234.jpg, html-file\1235.jpg, etc. The
html-file directory would say it's a bitmap in the database and then the file
name would be it's PK in the database.

Is there another way to do this? Because it looks like I can't use the
directory for the path. This is presently on the VS2005 integrated server but
it needs to work on IIS also.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

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


"Steven Cheng[MSFT]" wrote:
Hello Dave,

As for the httphandler configuration, as far as I knew, it supports limited
wildcard mapping format. So far based on my test, as long as you've
configured the IIS extension mapping to redirect the certain document
extension to ASP.NET isapi.dll, the following wildcard format httphandler
path is supported:

<add path="test.*" verb="*" type="PPTHandle r, __code"/>

<add path="*.test" verb="*" type="PPTHandle r, __code"/>

<add path="*asm.bsd" verb="*" type="PPTHandle r, __code"></add>

<add path="asm*.bsd" verb="*" type="PPTHandle r, __code"/>

As for the test path you provided, why did you put an "\" char in the path,
is it necessary for your application?
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 3 '06 #5
Hi Dave,

I would suggest you avoid using any particular characters (like the
backward slash ) in your custom httphandler's request url, you can use some
normal separaor char such as "-" to separate different part in your custom
handler's url and then parse them in your httphandler's code. e.g.

http://servername/appname/databasename-filename1.rpt

Also, directory path is not allowed as content in url path directly. The
correct way is to use them as a querystring parameter. I'm afraid there is
no other means for this so far.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 9 '06 #6
ok - thanks

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

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


"Steven Cheng[MSFT]" wrote:
Hi Dave,

I would suggest you avoid using any particular characters (like the
backward slash ) in your custom httphandler's request url, you can use some
normal separaor char such as "-" to separate different part in your custom
handler's url and then parse them in your httphandler's code. e.g.

http://servername/appname/databasename-filename1.rpt

Also, directory path is not allowed as content in url path directly. The
correct way is to use them as a querystring parameter. I'm afraid there is
no other means for this so far.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 9 '06 #7

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

Similar topics

1
3096
by: lapin | last post by:
I'm trying to get access to session variables from an IHttpHandler class. In several places I've seen the solution posted as in this message: >If you define your own custom HttpHandler, you need to >import the >System.Web.SessionState namespace, you >need it to implement the IRequiresSessionState interface
0
1082
by: Chris Hughes | last post by:
I have implemented a HTTP handler (IHttpHandler) for HTTP PUTs, and have some concerns as to the security of the solution. My initial tests suggest that write and execute permissions must both be given to the virtual directory owning the HTTP handler. Add to this that there are potentially many thousands of computers uploading to this directory, and this poses a very large security hole. But without both write and execute I haven't been...
13
4350
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
0
1243
by: Shaike | last post by:
We are trying to develop a webdav server side componenet that runs under the context of the IIS. This component suppose to expose a logical structures that stored in a DB as webdav folders/files structure. I implemented HttpHandler ,and installed it in a simple virtual directory. I also configured this handler to respond to all of the verbs (web.config + IIS wild card map).
24
2786
by: John Rivers | last post by:
ASPX which means ASPX pages, the code-behind concept, User Controls, Web Controls etc. is very poorly designed and makes it extremely hard to develop professional quality web applications. ASPX is Microsoft's attempt to "dumb down" web application development to help unskilled developers such as web design agencies achieve some results. For high quality applications IHttpHandlers are the way to go.
1
1530
by: David Thielen | last post by:
Hi; When I display reports, if it's a text file I need to have a .txt extension. This got me thinking, what would seem most natural to users is if the url ended up being something like: http://www.domain.com/asp_name/create-report/ReportTitle.pdf So anything under http://www.domain.com/asp_name/create-report/* goes to my IHttpHandler class ReportCreate. I use the report title as the file name and use the extension that matches the...
5
1714
by: shapper | last post by:
Hello, In this moment I am creating all my aspx pages on my vb.code at runtime. It seems nonsense to have .aspx and .aspx.vb files in my projects. I am considering creating my pages on the fly using IHttpHandler. I already did that for delivering XML files.
1
4338
by: Aartware | last post by:
I've read all the items about the IHttpHandler and the session-object and I see nothing wrong with my code, but still I have no session object. This is my code: Imports System Imports System.Data Imports System.Web imports System.Web.SessionState Imports System.Web.UI
0
9982
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10692
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8255
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7430
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6116
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3543
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.