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?

Thanks.

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

http://www.edthosting.com/Knowledgebase_Article.aspx?id=132
0
 
dr_binksCommented:
nope, all I get is some html & java code.
0
 
epmoAuthor Commented:
well, the above url is just an example, on ours it will save the dabatase to your disk
0
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!

 
DVation191Commented:
epmo,
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.

0
 
r-kCommented:
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.
0
 
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?
0
 
DVation191Commented:
are you using IIS or Apache?
0
 
epmoAuthor Commented:
IIS
0
 
r-kCommented:
>> 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.ConnectionTimeout=60
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:

 http://www.w3schools.com/ado/default.asp
 http://www.sitepoint.com/article/build-faq-asp-ms-access/2
 http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=166

 etc.

 Good luck.


0
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.