473,770 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to protect downloadable files?

Hi,

We have a web site which needs user to login. After login, there are some files available for download on some pages. A typical link of such file is like this one:
https://www.ourdomain.com/docs/contracts/c_02102006.pdf

I noticed that any one could get this file if the person knows this link regardless if this person has logged in or not.

Is there a way to prevent people who do not login to reach such downloadable files?

Thank you

Hongbo
Feb 24 '06 #1
3 1693
Hongbo

Rather than directing them directly to the file you could direct them to
a page that then checks if they're logged in, if they are then it performs
a server transfer to the file.

So your url could be > https://www.ourdomain.com/download.aspx?fileid=12323

Then in your page you could issue:

Server.Transfer ("https://www.ourdomain.c om/docs/contracts/c 02102006.pdf");

Providing they are logged in, otherwise they get re-directed to the login
page.

HTH
Kev
Hi,

We have a web site which needs user to login. After login, there are
some files available for download on some pages. A typical link of
such
file is like this one:
https://www.ourdomain.com/docs/contracts/c 02102006.pdf
I noticed that any one could get this file if the person knows this
link regardless if this person has logged in or not.

Is there a way to prevent people who do not login to reach such
downloadable files?

Thank you

Hongbo

Feb 24 '06 #2
Hongbo

Of course you could also not expose the file path at all and stream the contents
of the required file to the HttpResponse object, that would be better if
you want total control over who can access what.

kev
Hi,

We have a web site which needs user to login. After login, there are
some files available for download on some pages. A typical link of
such
file is like this one:
https://www.ourdomain.com/docs/contracts/c 02102006.pdf
I noticed that any one could get this file if the person knows this
link regardless if this person has logged in or not.

Is there a way to prevent people who do not login to reach such
downloadable files?

Thank you

Hongbo

Feb 24 '06 #3
Hi, Kev,

Thank you very much for your help!

I feel your 2nd method is what I am looking for.

Would you please give me a code example(or web link) on how to
stream the content of required file to the HttpResponse object?

Thank you and have a nice weekend

Hongbo
"Mantorok" <sp******@spam. com> wrote in message
news:3a******** *************** ***@news.rmplc. co.uk...
Hongbo

Of course you could also not expose the file path at all and stream the contents of the required file to the HttpResponse object, that would be better if
you want total control over who can access what.

kev
Hi,

We have a web site which needs user to login. After login, there are
some files available for download on some pages. A typical link of
such
file is like this one:
https://www.ourdomain.com/docs/contracts/c 02102006.pdf
I noticed that any one could get this file if the person knows this
link regardless if this person has logged in or not.

Is there a way to prevent people who do not login to reach such
downloadable files?

Thank you

Hongbo


Feb 24 '06 #4

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

Similar topics

11
8906
by: LarryM | last post by:
Hi, NB, not to stop capturing the single displayed Image, but to stop downloading the entire image directory. (In my Website you will do a search, and get some thumbnails, and these can be enlarged one by one). This topic seems to be frequent. Some says that you under no circumstances can protect your images, others seem to have preventing solutions.
3
2214
by: JJ | last post by:
Hi, I am writing a cart in ASP selling downloadable files. The files are stored on remote locations i.e. http://www.thisfilestore.com/file1.zip And have different extensions, i.e. they are not all zip files. I would like to write a script which cann be called which will allow the download of the file, without giving away the url. Any Ideas/examples welcome!
11
3368
by: siliconmike | last post by:
Is there a way to protect data files from access by root ? I have a data-centered website and would like to protect data piracy from any foot-loose hosting company employee. Any ideas? Thanks Mike
3
1798
by: Fabrizio | last post by:
HI, I'm trying to create an aspx page that lists all files that an user can download from a site simply clicking on the link. There is any example on the web? Thanks, Fabrizio
4
1345
by: Ray Stevens | last post by:
How do you protect files (such as .PDF) in a hosted (Interland) environment when you have no access to IIS?
1
288
by: Hongbo | last post by:
Hi, We have a web site which needs user to login. After login, there are some files available for download on some pages. A typical link of such file is like this one: https://www.ourdomain.com/docs/contracts/c_02102006.pdf I noticed that any one could get this file if the person knows this link regardless if this person has logged in or not. Is there a way to prevent people who do not login to reach such downloadable files? Thank...
12
11094
by: =?Utf-8?B?am9uaWdy?= | last post by:
I wrote a simple VB.NET application that imports and edits CSV files. Now I’d like to “lock” the raw (pre-import) CSV files so these cannot be opened separately. It is not high-sensitive data, I just don’t want folks to peek in the files. So time-consuming encryption is not necessary, just a simple password-to-open that I can program in my application so it internally opens the imported CSV file would be perfect, but I can’t...
14
3644
by: lalit | last post by:
Hi there, Can some plz suggest me a way to show .ppt files on my website that can't be copied or saved by user using asp.net. any idea !!!! thankx
16
2580
by: Martin Schneider | last post by:
Hi! I want to maintain a large file link list (to legal files, by the way :-)). The links should be protected from "grabbing", though. Is it possible to make the browser download a link without making the link itself public? Passing through the data is not an option due to legal issues in Germany, not mentioning the traffic. Thanks for your ideas and best regards,
4
1566
by: Jim Aikin | last post by:
I'd like to learn JavaScript while sitting in my easy chair with my laptop on my lap. Option 1: Buy a wireless router so I can access the plethora of online- only tutorials from anywhere in the house. Option 2: Buy a book and try to figure out how to read a book with one hand while using the laptop with the other. Option 3: Find a good downloadable tutorial (either PDF or a bundle of
0
9618
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.