473,770 Members | 4,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

protected download of files...

I am creating a series of downloadable articles, career
tools, spreadsheets, etc. However, some of the content is
for "registered " guest. The registrants are stored in a
database and logon.

I want to ensure that someone registered cannot simply
pass someone the path to the files for download. However,
I am not creating an actual system user name for the
folders where the various documents exist.

I don't want someone to logon, retrieve the path to a
file, and be able to send that path or return to that path
without having to logon.

How do I accomplish this?

Consider the following:
serverroot/registeredconte ntfolders would be protected by
a single logon name - not accessible via anonymous
access. User's logon to site and I auth them with their
user name but on the server side, auth with the single
account I am establishing for access to the protected
folders.

Any insight would be appreciated.

Thanks,
Matt
Jul 19 '05 #1
3 3749
On Fri, 12 Sep 2003 09:11:54 -0700, "Matthew Moran" <mm****@cbtoolk it.com> wrote:
I am creating a series of downloadable articles, career
tools, spreadsheets, etc. However, some of the content is
for "registered " guest. The registrants are stored in a
database and logon.

I want to ensure that someone registered cannot simply
pass someone the path to the files for download. However,
I am not creating an actual system user name for the
folders where the various documents exist.

I don't want someone to logon, retrieve the path to a
file, and be able to send that path or return to that path
without having to logon.

How do I accomplish this?

Consider the following:
serverroot/registeredconte ntfolders would be protected by
a single logon name - not accessible via anonymous
access. User's logon to site and I auth them with their
user name but on the server side, auth with the single
account I am establishing for access to the protected
folders.

Any insight would be appreciated.

Thanks,
Matt


Place the 'restricted' downloads on a page that has the following code ( or some equivalent to it ) immediately after
the BODY tag:

<SCRIPT Language="JavaS cript">
if (document.refer rer != "http://YourLogin_passw ordform_page.as p") {
location.href=" http://Someplace_else. asp"
}

</SCRIPT>
hth,

Jul 19 '05 #2
I have done this for several sites I have developed.

What I have done is create a "download.a sp" script which checks for the
appropriate permissions, then uses FileSystemObjec t to read the file from
disk Response.Conten tType, Response.AddHea der, and Response.Binary Write to
send the file to the browser.

This script is moste effective when the folder which stores the downloadable
files is outside the web structure, so there is no way that someone can get
to the files other than through download.asp. (For example, on the site I
was working on today, the client has the root folder for the domain at
d:\iisdata\www.myserver.com\html, and all of the downloadable files are in
d:\iisdata\www.myserver.com\downloads --since downloads is outside the web
root, there's no way to get to it from a browser.)

I have found added benefits by storing full names and paths to files in a
database, and only use a short ID to retrieve the file in my script. For
example, on the first site I developed using this method, I might have had a
link like
http://www.myserver.com/download.asp...s/glossary.doc.
As I kept reusing the same code, I figured out that it was even more
efficient to have a link like
http://www.myserver.com/download.asp?FileID=107 --not only does this mask
the full file name from the user, but it lets me easily flag files as
"members only" or "general public" by adding a field in the database, and it
eliminates problems I was having where people would try to publish documents
with names like "Member Dues & Fees.xls" (includes spaces and an &, which
were sometimes problematic for query strings!)

Hope that helps you get started,
Boris

"Matthew Moran" <mm****@cbtoolk it.com> wrote in message
news:27******** *************** *****@phx.gbl.. .
I am creating a series of downloadable articles, career
tools, spreadsheets, etc. However, some of the content is
for "registered " guest. The registrants are stored in a
database and logon.

I want to ensure that someone registered cannot simply
pass someone the path to the files for download. However,
I am not creating an actual system user name for the
folders where the various documents exist.

I don't want someone to logon, retrieve the path to a
file, and be able to send that path or return to that path
without having to logon.

How do I accomplish this?

Consider the following:
serverroot/registeredconte ntfolders would be protected by
a single logon name - not accessible via anonymous
access. User's logon to site and I auth them with their
user name but on the server side, auth with the single
account I am establishing for access to the protected
folders.

Any insight would be appreciated.

Thanks,
Matt

Jul 19 '05 #3
"Matthew Moran" <mm****@cbtoolk it.com> wrote in message news:<27******* *************** ******@phx.gbl> ...
I am creating a series of downloadable articles, career
tools, spreadsheets, etc. However, some of the content is
for "registered " guest. The registrants are stored in a
database and logon.

I want to ensure that someone registered cannot simply
pass someone the path to the files for download. However,
I am not creating an actual system user name for the
folders where the various documents exist.

I don't want someone to logon, retrieve the path to a
file, and be able to send that path or return to that path
without having to logon.


Matthew,

This is a common task, and you should be able to implement a solution
quickly. The best way to accomplish this is with an ASP download
script that uses software such as SoftArtisans FileUp
(http://fileup.softartisans.com). Using something such as FileUp to
handle the streaming of files is more reliable, more feature-rich, and
better performance-wise than just using the FileSystemObjec t (which
doesn't deal with binary files correctly) to stream your downloads.

-Chris
Jul 19 '05 #4

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

Similar topics

13
3661
by: Ken | last post by:
How do I download files from the internet server to my computer? How do I tell the script the correct hard drive folder on my computer to copy the files to? After connecting to the internet server, I am trying: $_SESSION = "/uploaddir/"; // directory on server $_SESSION = "c:/_picture_file/"; // directory on computer
3
1652
by: Taurkon | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I need to search and then open a file in a folder that is protected using NT2000 security. Is there a file open command that allows me to state the domain, user, and pswd for access rights to these files? I need to modify a current process to support this functionality and I myself am not a Windows c++ programmer and have not been able to find any libraries to support this...
1
1170
by: Garett Rogers | last post by:
I am creating a document manager for our intranet in VB.NET and I have stumbled across a problem that I cant seem to find a solution for. Everything is working as planned: 1) upload a file from webform 2) saves it in a folder outside the current application 3) you can download the file once it's uploaded The problem happens when a file is uploaded with an extension that's protected.. such as .vb, .config, .cs, etc. etc.
1
1653
by: www.MSmobiles.com | last post by:
hi, how can I implement passowrd protected access to IIS located files? for example: when somebody tries: http://x.msmobiles.com/a/dupa.pdf
5
3679
by: Stanav | last post by:
Hello all, Thanks in advance for any replies... Now, my question is: Is it possible to do a multiple files download for a single response event on an aspx page? If there is, please give me some directions/sample code or anything. On my web application, I have a CheckBoxList that shows all the files. The user will check (select) the files to download, then click on the "Download" button. A SaveAs dialog pops up to allow the user to...
4
2760
by: connoisseur.infotech | last post by:
hello we are developing one tool where we need to open and make password protected zip files. we found some solutions but they don't support password protected things. does any one knows about this or any aproach for this.
2
1464
by: jerryyang_la1 | last post by:
Hi. I'm looking for a way to allow users to download files, but what files they see and can download need to be restricted to their username.. I will have a couple of users who will have full access, the others need to see only the files I have allocated to them. Can this be done ?
1
3582
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time out whole script, just a part if file won't download in 2mins then skip to the next one. Previously, I had a Javascript implementation with AJAX, this time I thought of doing it in PHP since PHP has far better array functions, I don't have to do...
12
2915
by: devospice | last post by:
Hi, I'm trying to create a download counter for individual files on a web site and I'm not sure how to do this. Right now I'm using Webalizer to just read the log files and see how many times the files I'm interested in were downloaded. The problem is Webalizer breaks it up by month and I want a running total. I'd also like to see the counts without having to log in to Webalizer in the first place. Not that logging in or adding the...
0
9602
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
10237
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
10017
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
9882
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...
0
8905
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...
0
5326
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...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
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
3589
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.