logo

iis 6 won't serve mdb file

kpg posted on Thursday, March 08, 2007 10:07 AM

hi all,

I have written an asp.net 2.0 app that to allow users to
download files.  It does this by presenting the user with
a url to the file, they click it and save the file to their
local drive.

When the user clicks on an assess file (*.mdb) they get
an error "This type of page is not served" (logged as 403 0)

I know II6 only severs files with a defined MIME type, but
mdb files are defined in the MIME list (by default, I did
not need to add it)

So there must be another mechanism that prevents download.

I am aware that allowing IIS to serve mdb files is considered
a security risk, but this site is password protected and
serving mdb files is one of the reasons it exists at all.

So I have two questions:

1) Why are mdb files blocked even though they are a defined
MIME type for the IIS server.

2) How do I allow mdb files to be served (if not via the
MIME type)?

thanks
kpg
reply


The text string you give here is not coming from IIS.

Kristofer Gafvert posted on Thursday, March 08, 2007 10:20 AM

The text string you give here is not coming from IIS. So there has to be a
configuration on your server preventing mdb files from being served. Could
it be that you have mapped the mdb extension to ASP.NET? It looks like that.

In that case, you need to edit your web.config file.



--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
reply

iis 6 won't serve mdb file

kpg posted on Thursday, March 08, 2007 12:30 PM

OK.  mdb files are mapped (by default) to asp.net.  I found the
httpHandler
in the web.config file in the system .net configure folder, and it was
using the forbidden handler.

I made several faied attempts to edit the local web.config file to
remove
the httpHandler but then I got a page not found error.

So I ended up removing the mdb mapping for that web site, which has the
same effect as mapping it but then allowing access.

I suppose ideally I would like to use the <location> section to only
allow
mdb files for a particular page - but like I said the edits I tried in
the
web.config file did not produce the desired results.

this:


seemed to remove the handler, but since the file was still mapped
I got a page not found error.


this:

type="System.Web.DefaultHttpHandler" validate="True" />

and this:

type="System.Web.DefaultHttpHandler" validate="True" />

had the same effect, which puzzles me somewhat.

Removing the mapping by clicking configure on the directory tab
of the web site properties worked - but I think the web.config
technique is slightly more desirable (if possible).

thanks
kpg
reply

mdb files are not mapped to ASP.NET by default.

Kristofer Gafvert posted on Thursday, March 08, 2007 2:57 PM

mdb files are not mapped to ASP.NET by default. At least not on any system
i have used. Why would you desire to use ASP.NET to serve the file? It
requires more resources on the server, and i can see no benefit at all
using this technique for serving static files.

I think you need to consult the ASP.NET newsgroup for ASP.NET specific
problems.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
reply

iis 6 won't serve mdb file

kpg posted on Monday, March 12, 2007 8:22 AM

hmmmm...perhaps we are using different terminology.

When I say .mdb files are mapped to asp.net, what I mean is that
from the IIS configuration snapin, right clicking on the web
site tree node, going to properties, select the Home directory
tab, click configure, select the Mappings tab, .mdb files are
handled by C:\windows\ms.net\fw\v2.0.50727\aspnet_iisapi.dll.

This is true for all machines I have asp.net 2.0 installed on.

The site in question is a generic file transfer site, used in lieu
of an ftp site, designed to allow my clients to upload and download
files to me.  Sometimes the file will be an mdb file.

I use an asp.net app for this becuase my clients can use a web
browser but are often not technical enough to use an ftp site,
plus I use SSL and a custom login for security.

My dilemma stemmed from the fact that my users could not download
mdb files.  By removing the "mapping" they can now download mdb files.

Indeed, mdb files were being handled by the httpforbidden handler
due to the mapping.

In any case you have guided me to the solution,

thanks again
reply

won't serve mdb file

Hugh posted on Wednesday, April 18, 2007 12:28 PM

You say you were guided to the solution. Could you share the solution? I am using a shared hosted server and the only option I have is to use a web.config. Everything I have searched on says to change the ISS settings but I do not have that option.
reply

Solution

Hugh posted on Wednesday, April 18, 2007 1:56 PM

put a web.config in the directory or directory structure you want to allow the access database to download from.













The solution required that you first remove the system default and then add your own as aparentlly you can't just overwrite it (I tried). I had to figure out what the system default was since the remove has to match exactlly.
reply

Last post lost code due to open brackets make sure you put them back inremove

Hugh posted on Wednesday, April 18, 2007 1:58 PM

Last post lost code due to open brackets make sure you put them back in

remove verb="*" path="*.mdb" />
add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler"/>
reply

re solution

Hugh posted on Wednesday, April 18, 2007 2:03 PM

<configuration> <br />

<system.web><br />

<httpHandlers><br />

<remove verb="*" path="*.mdb" /> <br />

<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler"/><br />

</httpHandlers><br />

</system.web><br />

</configuration>
reply

 

Didn't Find The Answer You Were Looking For?

View IIS Posts   Ask A New Question

EggHeadCafe has experts online right now that may know the answer to your question.  We pay them a bonus for answering as many questions as they can.  So, why not help them and yourself by becoming a member (free) and ask them your question right now?
Ask Question In Live Forum

If you have an OpenID and do not want to become a member of the EggHeadCafe forum, you can also sign on to Chat Chaos and post your question to our real time Silverlight chat application.
Ask Question In Chat Chaos

Previous IIS conversation.

FrontPage Client    FrontPage Extensions WindowsNT    FrontPage Programming    IIS ASP DB    IIS ASP    IIS    IIS Security   






  $1000 Contest    [)ia6l0 iii - $231  |  Jonathan VH - $153  |  Huggy Bear - $133  |  egg egg - $100  |  F Cali - $93  |  more Advertise  |  Privacy  |   (c) 2010