Big Problem in File Downloading
Hi Java Gurus
I will explain the current setup:
* I've uploaded couple of files to a Server's web folder.
for example : http://myserver:8181/userFiles/files.ext
* i've to allow the users of my application to download those files. I need to give them the url for the files in the server upon request.
The Problem:
* The users can access the files with out logging into the system by typing the particular file's url in the browser.
for example : http://myserver:8181/userFiles/file-name.ext.
What i need :
* Before accessing a particular file, the user must be logged in. other wise they should not allowed to access the file using the url.
With regards
Mava
[749 byte] By [
mava43] at [2007-9-26 4:49:37]

The access of files is not programming issue. Either you have to change the address bar while you are going to the page with the file or you have to use OS security and access control.
If you needed more information on this e-mail me at arashsun@mysun.com what exactly you want to do and exaplain it in detail.
Check out the security descriptors in web.xml.
They can security protect any URL-pattern.
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/loginError.jsp</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>AllUsers</web-resource-name>
<url-pattern>/userfiles/*</url-pattern>
<description>All users</description>
</web-resource-collection>
</security-constraint>
jpardi at 2007-6-29 18:40:28 >

No, it's the configuration file for your application
server, like WebLogic, WebSphere, not Web Server, like
Appach. I think the previous answer can solve your
problem. Of course you can use HTTP authentication
managed by web server also, just like mentioned in
the second to the bottom post.
good luck
greenidiot