Jump to content
xisto Community
kvarnerexpress

Using Relative Paths With Mappath

Recommended Posts

I know this is an easy question (if you know the answer?) but I am at the ?hair pulling out? stage with this.Very simply, I have an Access database that I am accessing using ASP (ADO).If I have the database in the normal htdocs folder and use mappath to tell ASP where it is and what it is called, then no problem. Works perfectly.However, if I leave the database in that folder and someone ?views source? to find out the name of the database, then they can easily download the database. Not good.I have now put the database in the private folder (same level as htdocs. That is, /private and not /htdocs/private) so that the database cannot be downloaded (correct?).Problem is I now cannot figure out how to write the mappath so that ASAP can find the database! This is despite searching here, codefixer, w3schools, google etc etc.I know it?s easy to fix but I just can?t find the answer.Thanks in advance.

Share this post


Link to post
Share on other sites

Did you take a look at the IIS documentation ? if not, take a look of it, you will get more. <_< ok, let's return. If I'am not forget it. You can use .. to return to previous directory.let's say you have a site path with /htdocs and /private and currently in /htdocsyou have to specific Server.MapPath("../private/[something-to-specific]").one more to note if your server is disabled "Parent Path". This rule will not be apply. :lol: Hope this help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.