File Download

M

^MisterJingo^

Hi all,

I've written some code which allows a user to browse a directory and
any subdirectories it contains. The page which contains this can only
be browsed by users with a certain cookie (the page checks for this
before allowing access).
To stop files being downloaded through a link to them on a server
(potentially allowing unauthorized people access) I've put the
directory containing the files outside of the web root.
This all works fine, but i'm unsure how to go about offering the files
for download to people logged in.
I know there mgiht be easier ways of doing this, but i've been told
that there should be no login page, as the users of this file browser
will be linked to it from different VLEs - so a cookie solution was
chosen as it will be seemless.
Any help or advice on how to go about this would be appreciated.
 
M

msnews.microsoft.com

Create a page that checks the cookie, reads the requested file, sets the
MIME type to the file type and streams out the bytes.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top