View Full Version : Hosting a file for download

01-07-2008, 04:45 PM
I'm trying to find a way to let a user download a file, from a Java EE application, without using a direct link to the file. For example, if I have a pdf file thats located in a downloads directory of my application, the link might be:


We are trying to make it so that you will not be able to manually type the URL of a file into the address bar and get a file that you do not have access to. Does anyone have any ideas how this is usually done? Currently digging through books and crawling around the web, but haven't found anything useful as of yet.

01-07-2008, 08:19 PM
write ur own servlet that checks for a token plus some identifier to locate the actual file

01-07-2008, 08:22 PM
Wonderful timing, I was actually just starting to prototype that idea now. Thanks for the reply, I'll probably post results and an example if anyone is interested.