简体   繁体   English

通过PHP应用程序在客户端PC上打开Word文档

[英]Opening a word document on clients PC, through a PHP application

I am developing a web application in PHP as a replacement of Microsoft Access based application for a company. 我正在用PHP开发Web应用程序,以代替公司的基于Microsoft Access的应用程序。

In old access application in their database they were storing a link to a word document, which further links to other documents. 在他们数据库中的旧访问应用程序中,他们存储了到Word文档的链接,该链接进一步链接到其他文档。 Now in access form they are showing that link, when click on that link they can open the word document from a common folder in a network PC and make any changes the that file (pretty easy for user). 现在,他们以访问表单的形式显示该链接,当单击该链接时,他们可以从网络PC的公用文件夹中打开Word文档,并对该文件进行任何更改(对用户而言非常容易)。

Is there any way to do the same through the web-based application? 有什么方法可以通过基于Web的应用程序执行相同操作?


What if I just move the common folder in my www directory? 如果仅将公用文件夹移到www目录中怎么办?

In that case they can open the file easily, but if they have to make any change they have to download the file on their PC, and the changes will be done to their local file not in the file that is on server. 在这种情况下,他们可以轻松打开文件,但是如果必须进行任何更改,则必须将文件下载到PC上,并且更改将针对本地文件而不是服务器上的文件进行。 So they need to move file to server back or ask network admin for moving the file back to the server 因此,他们需要将文件移回服务器或要求网络管理员将文件移回服务器


What if I keep common folder in a network PC it self and try to access it form there? 如果我将公用文件夹自己保存在网络PC中并尝试从那里访问它怎么办?

Just by clicking I can't open a file form client's or any other network PC. 仅单击我就无法打开客户端或任何其他网络PC的文件形式。 For this when click on the link I have to open & read file through PHP on web server. 为此,当单击链接时,我必须通过Web服务器上的PHP打开和读取文件。 Using any document to PDF converter, I have to convert the file format and then open it in browser. 使用任何文档到PDF转换器,我必须转换文件格式,然后在浏览器中打开它。 Here the problem are, 这里的问题是

  • Still I can't make changes in file and 仍然无法更改文件和
  • I have to fix about the format that I might need to convert in PDF. 我必须解决可能需要转换为PDF的格式。
  • I am not sure how the other documents that are linked to the main document will work. 我不确定链接到主文档的其他文档将如何工作。

There's two ways of doing this: (a) let the user download it from your web application, either statically (stored on the web server) or dynamically (processed in PHP or even built in real-time). 有两种方法可以做到这一点:(a)让用户从您的Web应用程序中静态下载(存储在Web服务器上)或动态下载(在PHP中处理,甚至是实时构建)。

Or, (b) use a file link to a known location on the user's disk, such as file://C:/mydoc.doc. 或者,(b)使用文件链接到用户磁盘上的已知位置,例如file:// C:/mydoc.doc。

Addendum - if you want to write to the file in your web app, but also have the user open the same copy, use (b) rather than (a). 附录-如果要写入Web应用程序中的文件,但又希望用户打开相同的副本,请使用(b)而不是(a)。 This presumes that the location of the file is available through a local or network path. 这假定该文件的位置可通过本地或网络路径获得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM