Web Hosting Talk







View Full Version : How do I protect files?


WebBloom
11-01-2001, 07:09 PM
I would like to protect the files on my website.

Specifically, when a user types the full address to one of my javascript files I don't want them to be able to download the file.

Currently, if the user types in a folder name they get a 403 error however, if they know what the file name is called they can type this full address in and get to a download screen.

Is there anyway to prevent users from downloading external javascript files?

Thanks.

ShellBounder
11-01-2001, 10:13 PM
Unfortunately, no. Once a user has viewed a page with a linked JavaScript file on it, they can do whatever they want to with it. Sorry.

WebBloom
11-01-2001, 10:24 PM
There's nothing that you can do even if the Javascript is not contained within the html?

The user can't see the Javascript unless they go out of their way to download the actual file. I want to prevent them from downloading this file.

Any ideas?

Tim Greer
11-01-2001, 11:39 PM
If you deny them viewing the file, then you deny the file from being able to be used in the HTML page that they are supposed to see. There's no way to protect such code. You can try and do some weird type of crypt on the code, but that's sort of useless if someone wants to use it or see what you did and I've never personally tried or cared to try to hide HTML, images or JavaScript and other such things, so maybe someone else will have better information about that. All in all, there's really no reason to hide things, since once they are online, they are there for all to view, since that's what you want them to do. Given that fact and the purpose, there's no way to stop people from grabbing things you allow them to see. Perhaps you can look into alternative meansto offer an interactive value, that can't be simply copied and altered. Java comes to mind, as does Flash.