0

Here is the case.

User should be able to open MS Word document which is located somewhere in the network (ie. \remote\machine\documents\document_to_edit.docx) with MS Word 2007 by clicking link in the browser. Browser is IE7+.

Edit the document, close it and save it (no "Save as..." just "Save") in the same place in the network (\remote\machine\documents\document_to_edit.docx)

Is that at all possible? If so how should I do that?

Don't think this is relative, but I'm using JAVA + Wicket for my web application.

EDIT:
Any suggestions are welcome. Main thing is - open file as it was on your computer and save it after edit.

Martynas Jurkus
  • 9,231
  • 13
  • 59
  • 101

2 Answers2

1

(Read update below)

Short answer: not possible.

Long answer: When you open anything from a browser, even some local file, it will open the given file from the browser cache (or some temporary download directory) but not the original file linked. Therefore, after you save the changes the copied file will be updated.

Added:

Ok, after I thought about it for a while, there could be some ways to do it in intranet application. Here's how: Java applet: run native code from browser?

So, basically, you will serve the applet which will communicate with your javascript (I guess this way would be easiest to implement) (info on how to do it) and send a network path to the applet. Applet will start winword.exe passing it the required parameters.

Or, there's another option with ActiveX: http://codereflex.net/how-to-run-exe-on-webpage/ . The downside is - it works only with IE, but that seems what you need anyway.

Community
  • 1
  • 1
bezmax
  • 25,562
  • 10
  • 53
  • 84
  • It is possible but maybe not how he want's, he can use a ftp to save the file on the remote host. –  Jun 21 '12 at 19:15
  • @Arno Hm, I'm not sure I understand your idea. Do you mean redirecting user to some "ftp://.../" address, so the Internet Explorer would switch to Windows Explorer and serve the file "directly" from FTP? – bezmax Jun 21 '12 at 20:11
  • Maybe there is a possibility to launch winword.exe with parameters to file location in the LAN? – Martynas Jurkus Jun 21 '12 at 20:38
  • 1
    @Arno Ok, I've just tested and it does not work with IE7. IE won't switch to Windows Explorer automatically (for whatever reason), therefore it servers the contents of FTP as if it was any other webpage. So the answer is still "not possible". – bezmax Jun 22 '12 at 08:37
  • @MartynasJurkus I've updated my answer with new information I thought of. – bezmax Jun 22 '12 at 08:44
  • @Max Well, first option is not quite as simple as one would hope. To access local files your applet must be signed. That's ok, but it also requires policy file to use Desktop methods, which must reside in local system at specified location. Or am I missing something? – Martynas Jurkus Jun 27 '12 at 18:50
  • @MartynasJurkus What about using `Runtime.exec(String)`? Does it work? – bezmax Jun 28 '12 at 06:49
  • Yes and no :) Something wrong with permissions. Added another question here: http://stackoverflow.com/questions/11252145/signed-java-applet-gives-accesscontrolexception-when-calling-from-javascript – Martynas Jurkus Jun 28 '12 at 20:39
1

IE can open \\server\share\file.docx type links and it opens the original file, not a downloaded version. You may need to add the domain of your http server to trusted sites in the security settings of IE first though. Have tested this and it does work

user1731782
  • 322
  • 2
  • 12