Avoid file download from a server

how can you Avoid file download from a server when you type:  http://www.domain.com/database.mdb

Anyone can download the database?


Who is Participating?
Title: Securing Access Database from being downloaded
Description: I would like to secure my access database from being downloaded via the web.

nope, all I get is some html & java code.
epmoAuthor Commented:
well, the above url is just an example, on ours it will save the dabatase to your disk
On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

Well, what do you want to happen when you go to that url? IE Can't view an .mdb file as far as I know...downloading it is all it can do.

You should put your database in a folder that is not accessible from the web. That is the only way to assure that people cannot download it.
epmoAuthor Commented:
Tanks  - yes, we do not want the database to be downloaded

> a folder that is not accessible from the web

and How do you do that?
are you using IIS or Apache?
epmoAuthor Commented:
>> a folder that is not accessible from the web
>and How do you do that?

 I am assuming this is a database used by some .asp pages to serve data via the web.

The important thing is that you can place the database file itself almost anywhere on the disk (but outside the folders accessible to the web server). For example, suppose the website is all in a folder named c:\web (and subfolders within c:\web). We may decide to put the database in a folder named c:\data.

The next step is to register your database as a data source with your system. This is done via the ODBC control panel (Control Panel -> Admin Tools -> Data Sources(ODBC)).
Click on "System DSN", then the Add button, and give it a suitable name and point it to your database in c:\data.

The final step is to use that name when accessing it from your .asp page.
For example, suppose we named it ACCOUNTS in the ODBC control panel, then you would use commands similar to the following in your web page:

Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.Open "DSN=ACCOUNTS"

Further details need to be filled in by you, but this way you keep your database away from the website, and still be use the data from within a web page.

There are many ASP tutorials on the web. Here's a couple:



 Good luck.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.