aspose file tools*
The moose likes Servlets and the fly likes List of downloaded files has to appear based on the User Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "List of downloaded files has to appear based on the User" Watch "List of downloaded files has to appear based on the User" New topic
Author

List of downloaded files has to appear based on the User

indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
Hi,

This is regarding file uploading and downloading..
There are somany files uploaded to the server by authenticated users.(yes, already doing authentication).

One user has the right to download files , if they are uploaded by himself only.

for eg., if I click "DownLoad" option, the list has to display the files which are uploaded by me only, not other's uploaded files.

Can you please tell me what I have to do for this?
thanks
indu


thanks,
indu
Vijay Jeyam
Greenhorn

Joined: Nov 12, 2008
Posts: 15
Is the file is in stored in database or is it stored in the FileSystem.
If it is stored in the database you can use audit coulums and join the logged in user id to get the list of files to be displayed.

If you dont have that in database. On each upload you have to assign the file to the user in the database, or XML file. whenever the user want to download the system will refer the XML of the DB to provide a list of files to be downloaded.


Never Never Never Give Up...!!!
indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
My files are uploaded to the server not to the database.
Sorry, Am not able to get you properly, am a new developer and this is my first web application . Can you explain it a bit eloborated ?

In the uploading function itself, I have to store the username also?

thanks
indu
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
What vijay is suggesting is that you store in the database the username and the location of that file on the filesystem (the path on file system and not the actual file's content). When the user requests for the files, you need to query the database for that user requesting and get the files he has uploaded till date.
But this apprach will work only if the hosting server gives your web application permission to write to file system.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List of downloaded files has to appear based on the User