views:

182

answers:

1

In my attempts to write a CMS or intranet system, I need the ability to upload files to a "workspace", which is permissions based.

Now I can sort the permissions out, however, I am struggling a bit with the file upload itself.

Basically, such as a VLE, let's say I am a manager. I want to upload a file for those in my department to see. How do I do this?

Now, I could easily upload the files to the server via FTP, however, this isn't practical from a remote location, hence the need to upload.

The file should be stored in the /upload/ folder, and have a random string, such as vBulletin does with it's user's images.

Thanks

+1  A: 

The actual file upload is relatively simple. There are tons of tutorials like this one to help. You will need to use a database to manage the permissions though.

For instance, when you upload a file, note its name and location along with an owner or a set of permissions in the database. When someone requests a file you can always check the database for the permissions.

For example

file =(id, filename, location, ...)
user = (id, username, password, ...)
filegroup = (id, groupname, ...)
file_filegroup(fileid, groupid, ...)
uer_groups = (groupid, userid, ....)

this structure would allow you to store files as groups such as a department group and allow a user to have access to one or more groups.

Vincent Ramdhanie