CMS/内网文件上传系统
在我尝试编写 CMS 或 Intranet 系统时,我需要能够将文件上传到“工作区”,这是基于权限的。
现在我可以解决权限问题,但是,我在文件上传本身方面遇到了一些困难。
基本上,例如 VLE,假设我是一名经理。我想上传一个文件供我部门的人员查看。我该怎么做?
现在,我可以轻松地通过 FTP 将文件上传到服务器,但是,这在远程位置不切实际,因此需要上传。
该文件应存储在 /upload/ 文件夹中,并具有随机字符串,例如 vBulletin 对其用户图像所做的操作。
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际的文件上传比较简单。有大量像这个这样的教程可以提供帮助。不过,您将需要使用数据库来管理权限。
例如,当您上传文件时,请记下其名称和位置以及数据库中的所有者或一组权限。当有人请求文件时,您始终可以检查数据库的权限。
例如,
此结构允许您将文件存储为组(例如部门组),并允许用户访问一个或多个组。
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
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.