使用户能够修改应用程序存储的文档
我们有以下场景:
* .NET 应用程序允许用户上传文档。
* 文档存储在文件系统中,当前用户无法访问。路径基本上是 \year\month\day\filename.ext
* 路径和文件名存储在数据库(MS SQL200)中,该数据库用于将文档链接到系统中的各种记录
问题:
如何实施以下情况:
我们维护文件和记录之间的链接
我们允许用户修改文件并轻松访问它们
我们防止文件和数据库不同步的情况。
它必须尽可能用户友好(例如,没有“下载文件,修改并再次上传”)
感谢您提供任何提示和方向指示 马泰杰
we have the following scenario:
* a .NET application allows users to upload documents.
* the documents are stored in a filesystem, currently inaccessible to users. the path is basically \year\month\day\filename.ext
* the path and filename are stored in a database (MS SQL200) that is used to link the documents to various records in the system
the question:
how to implement a situation where:
we maintain the link between the files and the records
we allow users to modify the files and to access them easily
we prevent situations where the files and the db would become unsynchronized.
it has to be as user friendly as possible (e.g. no "download the file, modify and upload it again")
Thanks for any hints and pointers to a direction
Matej
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在重新发明轮子之前,您是否考虑过 SharePoint?
Before you reinvent the wheel, have you considered SharePoint?
正如 Andrew 所说(+1),您应该考虑 Sharepoint。那将是我的第一个选择。
如果您仍然需要从头开始,您的文件系统文件夹将需要将其 ACL 权限限制为由您的应用程序(可能是您的应用程序池用户)控制的唯一用户。仅允许该用户操作该文档。或者您可以考虑将它们存储在数据库中,就像 Sharepoint 一样。
您需要处理用户在同一天上传同名文件的情况。
要下载它们,您可以从实现 IHttpAsyncHandler 开始;它一开始很琐碎,但很容易变得复杂。
As Andrew said (+1), you should to consider Sharepoint. That would be my first option.
If you still need to do it from scratch, your filesystem folder will need to have their ACL permissions restricted for a unique user, controlled by your application (maybe your application pool user). This user, and only this, is allowed to manipulate that documents. Or you can consider to store them in your database, just like Sharepoint does.
You'll need to deal with users uploading files with same name in same day.
To download them, you can start by implementing a
IHttpAsyncHandler
; it's starts trivial, but get complicated very easily.