473,802 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3382
Also, by the way, I am getting the following error message when I try
to alter the database:

System.Data.Ole Db.OleDbExcepti on: 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
"sumguyovrt har" <su***********@ gmail.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.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 HttpForbiddenHa ndler for this in web.config

just add

<add verb="*" path="<your path>" type="System.We b.HttpForbidden Handler " />

---
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/
=============== =============== =====
"sumguyovrt har" <su***********@ gmail.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.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 (MicrosoftAcces s), 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
13626
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. <? header("Content-Type: application/octet-stream"); header("Content-Length: 5"); header("Content-Transfer-Encoding: binary");
0
1495
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 fine except that the downloaded file has size zero and has no content. Is there anything I can do (perhaps with the HTTP headers) to get the whole file through Norton firewalls - I have included the relevant part of my code below. Note that the...
3
1862
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 href="file.txt">Download the file</a> but it display it, and it does not ask me to download it. (of course I could download it by clicking the right button, but my boss doesn't want that: he wants 2 different links).
3
18934
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
12314
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. On Beta1, I am able to execute a particular page with no problem, that page opens up in the comes up just fine. On Win2kdev1, when I go to execute the same page, it opens a file download dialog and asks me whether I want to open or save the...
13
3326
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 visitor fills out the form and submits it, this calls a rather ordinary asp script like formmail.asp that sends the emails and displays a "thank you" web page. At the very end of my "thank you" web page I placed the following: <script...
9
2295
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 using one code (got from internet) i tried to modified it every way but every time file download dialog box opens but it downloads blank file.. neither it checks for file existence..... any help would be appreciated.. Presently i'm using...
3
1651
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 the images yet still allow them to show if a viewer wants to see them? (I assume image streaming would be the way to do that) or preferably B) Allow them to download the picture but if the picture is downloaded it shows a watermark. He doesnt...
1
47493
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.