473,404 Members | 2,174 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,404 software developers and data experts.

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/registeredcontentfolders 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 3701
On Fri, 12 Sep 2003 09:11:54 -0700, "Matthew Moran" <mm****@cbtoolkit.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/registeredcontentfolders 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="JavaScript">
if (document.referrer != "http://YourLogin_passwordform_page.asp") {
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.asp" script which checks for the
appropriate permissions, then uses FileSystemObject to read the file from
disk Response.ContentType, Response.AddHeader, and Response.BinaryWrite 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****@cbtoolkit.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/registeredcontentfolders 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****@cbtoolkit.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 FileSystemObject (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
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...
3
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...
1
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...
1
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
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...
4
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...
2
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...
1
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...
12
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...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
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
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...
0
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...
0
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,...
0
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...

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.