Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List of downloaded files has to appear based on the User

 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Vijay Jeyam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic