• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is creation of folder at runtime a good practice?  RSS feed

 
dimpsonu arora
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on a web application which has two types of users.

A. Users who are acting as Publisher and can upload documents. These users can be multiple. (Requires Login)
B. Users who are General users and will read the documents uploaded by Publishers after search publishers. (Don't require Login).

General Users shall first search a particular Publisher and then get the list of all the documents uploaded by that particular Publisher.

Now, To manage this thing, When the Publisher comes for the first time, I am creating a folder at run time with his unique Id and progmatically uploading all his documents to his folder.

This way, every publisher has its documents stored in its folder and I am providing link to the corresponding folder after the search result.

Now, I am doubtful that creating folder at runtime may not be safe or good practice. It might be operating system dependant or might have some sort of security threats. It is also possible that due to some restriction on production server, creation of folder at runtime is not allowed.

Can somebody suggest me if we can do something better and secure. What are the good practices Or can we make use of some open source for this scenario.

Thanks in advance for all the help.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's easy to program the creation and access of files/directories in a platform-independent way, and the security manager on the production platform should certainly let the application read and write files within that web app's directory. So I wouldn't be concerned about that.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!