By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

Set IHttpHandler for all files in a directory?

P: n/a
Hi;

I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
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="BitmapView"/>
That works - but it is not what I need.

Any ideas?

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

Cubicle Wars - http://www.windwardreports.com/film.htm
Oct 2 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
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="BitmapView"/>
That works - but it is not what I need.

Any ideas?

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

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

P: n/a
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="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
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="BitmapView"/>
That works - but it is not what I need.

Any ideas?

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

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

P: n/a
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="PPTHandler, __code"/>

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

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

<add path="asm*.bsd" verb="*" type="PPTHandler, __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

P: n/a
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_windward_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="PPTHandler, __code"/>

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

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

<add path="asm*.bsd" verb="*" type="PPTHandler, __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

P: n/a
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

P: n/a
ok - thanks

--
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,

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 discussion thread is closed

Replies have been disabled for this discussion.