473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Disallow download of certain file type

Hi. I can't place an mdb database above the http root, so anyone is
able to download it through their browser if they know where it is.
This database contains some sensitive information. I am used to Apache
server and open source languages, I think web.conf is sort of
equivalent to Apache's .htaccess, is there some way I can edit
web.conf to disallow access to mdb files?

I'm sorry if this is not the exact group I should be posting in, but I
don't know where else to post. I am developing the application in
ASP.net, so I figured this would be an appropriate place.

-Mike PII

May 10 '07 #1
5 3359
Also, by the way, I am getting the following error message when I try
to alter the database:

System.Data.OleDb.OleDbException: Operation must use an updateable
query.

This is a permission error, right? I found a page on Microsoft support
about it here:
http://support.microsoft.com/kb/175168
but I'm wondering if there might be some other cause for the error.

-Mike PII

May 10 '07 #2
You'd typically use IIS to set what kinds of files can and cannot be
downloaded.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"sumguyovrthar" <su***********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hi. I can't place an mdb database above the http root, so anyone is
able to download it through their browser if they know where it is.
This database contains some sensitive information. I am used to Apache
server and open source languages, I think web.conf is sort of
equivalent to Apache's .htaccess, is there some way I can edit
web.conf to disallow access to mdb files?

I'm sorry if this is not the exact group I should be posting in, but I
don't know where else to post. I am developing the application in
ASP.net, so I figured this would be an appropriate place.

-Mike PII
May 10 '07 #3
Hello sumguyovrthar,

Use HttpForbiddenHandler for this in web.config

just add

<add verb="*" path="<your path>" type="System.Web.HttpForbiddenHandler " />

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

sHi. I can't place an mdb database above the http root, so anyone is
sable to download it through their browser if they know where it is.
sThis database contains some sensitive information. I am used to
sApache server and open source languages, I think web.conf is sort of
sequivalent to Apache's .htaccess, is there some way I can edit
sweb.conf to disallow access to mdb files?
s>
sI'm sorry if this is not the exact group I should be posting in, but
sI don't know where else to post. I am developing the application in
sASP.net, so I figured this would be an appropriate place.
s>
s-Mike PII
s>
May 10 '07 #4
If what you want to do is prevent a download of your .mdb file,
just create an App_Data directory and place the Access database in it.

Files stored in the App_Data folder are not returned in response to direct HTTP requests,
which makes the App_Data folder the recommended location for data stored with your
application, including .mdf (SQL Server Express Edition), .mdb (Microsoft Access), or XML files.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"sumguyovrthar" <su***********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hi. I can't place an mdb database above the http root, so anyone is
able to download it through their browser if they know where it is.
This database contains some sensitive information. I am used to Apache
server and open source languages, I think web.conf is sort of
equivalent to Apache's .htaccess, is there some way I can edit
web.conf to disallow access to mdb files?

I'm sorry if this is not the exact group I should be posting in, but I
don't know where else to post. I am developing the application in
ASP.net, so I figured this would be an appropriate place.

-Mike PII

May 10 '07 #5
On May 10, 12:26 am, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:
If what you want to do is prevent a download of your .mdb file,
just create an App_Data directory and place the Access database in it.

Files stored in the App_Data folder are not returned in response to direct HTTP requests,
which makes the App_Data folder the recommended location for data stored with your
application, including .mdf (SQL Server Express Edition), .mdb (MicrosoftAccess), or XML files.

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
Thanks, that's just what I needed. Fixed both problems (apparently
App_Data has more compatible permissions by default too).

-Mike PII

May 10 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Frank Thorstens | last post by:
Hi, i try to give my script headers so the output text would be downloaded in the client's browser and not displayed. But it doesn't work at all in my IE 6 and Opera. <?...
0
by: Morten Jensen | last post by:
Hi I have a problem with a script that allows a user to download a .exe file. It works fine for all browsers that I have tried, but only behind certain firewalls. With Norton, everything looks...
3
by: timbratureman | last post by:
I have a txt file in my server. I have to provide to the user 2 links. One link is to download the file and the other one is to display it inside the browser. Is it possible? I made <a...
3
by: David Reynolds | last post by:
Does anyone know how I could stream Excel to the browser for download without saving the file somewhere first. I wasn't sure how I would go about it.
5
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. ...
13
by: bmurphy | last post by:
Last week after much searching, I found the answer to my problem in this newsgroup. I can't find the thread from which I got my solution, but I wanted to report back what worked. When the site...
9
rpnew
by: rpnew | last post by:
Hi, I'm very new to PHP and making one project.. what i want to do is .. i want to make a file download facilities thorough which user of my web pages can download selected file. presently i'm...
3
by: Chuckhriczko | last post by:
I have a client who needs his photographs shown on his website but at the same time he cannot allow people to download the image. I have two thoughts. A) Is it possible to disallow downloading of...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.