Hey, Fellow Web Coders...
Apr. 11th, 2006 01:03 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So I'm building a site in ColdFusion in which there are data files (e.g., MS Word Documents) that are linked to for download in a password-protected area of the site. The problem is, since the files are not .CFM files, linking directly to them bypasses the "application.cfm" file and thus bypasses the password protection script.
So what I need to do is find some way to prevent people from figuring out the links, or to make it so that linking directly to the file doesn't work. While I don't think it's particularly likely that people who have been given password access are going to just send people direct links to these files right and left, I have to build the page assuming that sooner or later, due to malice or stupidity, they will.
So ... any suggestions?
IMPORTANT NOTE: I am not allowed to use Javascript.
-The Gneech
So what I need to do is find some way to prevent people from figuring out the links, or to make it so that linking directly to the file doesn't work. While I don't think it's particularly likely that people who have been given password access are going to just send people direct links to these files right and left, I have to build the page assuming that sooner or later, due to malice or stupidity, they will.
So ... any suggestions?
IMPORTANT NOTE: I am not allowed to use Javascript.
-The Gneech
no subject
Date: 2006-04-11 05:21 pm (UTC)Option 2 - Use the webserver's auth methods via your program directly. That is, your code ties into "apache" mod_auth plugin and if someone fails a session check it signals the web server to not allow them access in the area. This is the most optimal solution from an web application point of view, however it requires access to the server app and also a fair amount of coding, thus, option #3:
Option 3 - old school method - Write a file.cfm that serves the files. Quite literally it checks the users authentication, etc, and then based upon form submits or the encoded URL info it copies a file off the drive, slaps a content header on it, and spits it out. If the user fails auth, it should throw a CGI redirect to a standard error page. The only downside to this is you're forking a CGI process for each hit, but requires no server work or javascripty or nothing. Also make sure it can't be teased to serve up anything but the files you want. Old school.
no subject
Date: 2006-04-11 05:22 pm (UTC)no subject
Date: 2006-04-11 07:10 pm (UTC)-TG
no subject
Date: 2006-04-11 10:19 pm (UTC)no subject
Date: 2006-04-11 05:46 pm (UTC)no subject
Date: 2006-04-11 07:51 pm (UTC)-TG
no subject
Date: 2006-04-11 07:59 pm (UTC)no subject
Date: 2006-04-11 05:47 pm (UTC)