如何将 Word 文档从 ASP.NET Intranet 保存回主服务器?
我有一个 ASP.NET Intranet 应用程序,其中有一个文档库部分。 用户可以单击驻留在服务器上的 MS-Word 文档的链接,然后可以根据需要在浏览器 (IE) 中编辑该文档。
问题是,当他们要保存更改时,需要将其写回到服务器,而是希望将其保存在本地系统上。
有什么想法可以让它保存回主服务器吗?
提前致谢。
I have a ASP.NET intranet application that has a document library section. The user can click on a link to a MS-Word document that resides on the server and can then edit the document if required within the browser (IE).
The problem is that when they come to save their changes it needs to write it back to the server but instead wants to save it on their local system.
Any ideas how I can get it to save back to the main server ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将文件上传回服务器。
这是互联网还是内联网应用程序? 如果是 Intranet,您可以直接保存到 \\myServer\myFolder\...
如果它是 Internet 应用程序,因此最终用户无法直接访问服务器文件,您需要创建一个 Office 加载项(使用 Visual Studio Tools for Office),称为“保存到服务器”,并且将运行“http://www.mydomain.com/updatefile.aspx”和该页面将进行更新。
请记住,使用与原始文件名不同的文件名进行更新,如果更新正常,则删除旧文件,并重命名新文件(或者为用户提供版本系统并将服务器上的文件重命名为 [myFile]_[currentDate]例如 .docx
链接:
如何使用 Visual C# 将文件上传到 ASP.NET 中的 Web 服务器.NET
you need to upload the file back to the server.
Is this a internet or intranet application? if intranet you could save directly to \\myServer\myFolder\...
If it's a internet application, so the end user does not access to the server files directly you need to create a Office Add In (using Visual Studio Tools for Office), called "Save to Server" and that will run "http://www.mydomain.com/updatefile.aspx" and that page will do a Update.
remember, Update with a filename diferent from the original, and if the update was ok, then delete the old, and rename the new (or give the user a version system and rename the file on the server to [myFile]_[currentDate].docx for example.
links:
How to upload a file to a Web server in ASP.NET by using Visual C# .NET
Word 文档的链接可以是 file:// url。
使用此方法,用户可以直接在共享上打开文件。
The link to the word document can be a file:// url.
Using this method the user can open the file directly on the share.
假设您的 Intranet 应用程序支持写回服务器,您需要向 Web 应用程序运行的帐户授予写入存储文档的文件夹的权限,除非它使用模拟,否则它模拟的用户将需要权限。
Assuming your intranet applicaiton supports writing back to the server, you would need to give the account that the web application runs as permission to write to the folder the documents are stored in, unless it is using impersonation then the users it is impersonating would need ther permissions.