aspose file tools*
The moose likes Java in General and the fly likes Where to save a file separately for different users in same web server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Where to save a file separately for different users in same web server?" Watch "Where to save a file separately for different users in same web server?" New topic
Author

Where to save a file separately for different users in same web server?

harry flower
Greenhorn

Joined: Aug 29, 2007
Posts: 19
Hi,

I am writing a web application to be run in Unix Server.
I wish to save a file from a FTP server to the web server.
But this file is to be save temporary in the web server, make same updates and will be deleted after used.
As there might be many users downloading the same file but the
content of this file might be change differently depending on different users, so usually where is the best location in the web server to store this file separately for different users?

Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42945
    
  68
Could you change the filename so that it contains the userID or user name? That way the files wouldn't get in one another's way.
harry flower
Greenhorn

Joined: Aug 29, 2007
Posts: 19
Yes but my concern is which directory in the web server should I temporary stored these files?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42945
    
  68
Any place that's not publicly accessible, e.g. a subdirectory of WEB-INF.
harry flower
Greenhorn

Joined: Aug 29, 2007
Posts: 19
Then is there a java command to access the subdirectories in WEB-INF?
I tried to use this command: 'getServletContext().getRealPath("/")',
is it pointing to the correct location?
I am running my web application in Eclipse.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where to save a file separately for different users in same web server?