Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
harry flower
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes but my concern is which directory in the web server should I temporary stored these files?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any place that's not publicly accessible, e.g. a subdirectory of WEB-INF.
 
harry flower
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic