CMS/内网文件上传系统

发布于 2024-08-10 05:33:50 字数 285 浏览 5 评论 0原文

在我尝试编写 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花之痕靓丽 2024-08-17 05:33:50

实际的文件上传比较简单。有大量像这个这样的教程可以提供帮助。不过,您将需要使用数据库来管理权限。

例如,当您上传文件时,请记下其名称和位置以及数据库中的所有者或一组权限。当有人请求文件时,您始终可以检查数据库的权限。

例如,

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

此结构允许您将文件存储为组(例如部门组),并允许用户访问一个或多个组。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文