• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Edit a word document from server

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I'm working in an application than will let the user open a word document from the server, edit and save it to the server without making an upload.

I have been searching for few days and found several solutions but all of them require some changes on client machines. I'm using webdav for this.

The direct solution (set a direct link to the file) opens the document inside the browser (if i open it in IE) and users want to open it outside the browser, using Word. To solve this, the only solution i have found is to change in every client machine the configuration for doc files in the windows explorer. Is that true?

The other problem with the direct link (coming from firefox or IE) is that when it opens, it's read-only file. The solution, again, is in the client side, adding some code at the windows registry to allow office to open web-documents to open as read-write (solution from microsoft)

Another solution is activeX. Setting this in my jsp

will open the file outside the browser and read-write but requires the user to use IE and the security (in the client side) must be set to allow scripting ActiveX components that are not marked as safe for scripting.

Finally, from java, something that seems not to be a solution. If i set this as the response:

where buf is a byte[] with the file comming from the DB. The result is that word is open with the read-write document, but it points to the local temporal IE folder to a file witn the name http___localhost_8080_myApp_documents_myDoc.doc

Do you know any way to edit this doc file without any change in client machine?

Thanks and sorry for my english.
>
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The direct solution (set a direct link to the file) opens the document inside the browser (if i open it in IE) and users want to open it outside the browser, using Word. To solve this, the only solution i have found is to change in every client machine the configuration for doc files in the windows explorer. Is that true?


Yes. You could change the content type to be something other then Word to force the user to have to save the doc first (as you have spotted), but that's not really a very elegant solution. IE and Mime type handling behaviour is configured in the registry. ActiveX is your best bet if you want to edit docs directly.

What I might do is enforce a lock document, download, edit, upload and unlock flow. This is how MS's own SharePoint works. If your application is anything other than a small(ish) intranet you'll need to include mechanism to break locks if required.
 
Jordi Penedes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Sturrock wrote:Yes. You could change the content type to be something other then Word to force the user to have to save the doc first (as you have spotted), but that's not really a very elegant solution. IE and Mime type handling behaviour is configured in the registry. ActiveX is your best bet if you want to edit docs directly.

What I might do is enforce a lock document, download, edit, upload and unlock flow. This is how MS's own SharePoint works. If your application is anything other than a small(ish) intranet you'll need to include mechanism to break locks if required.



Thanks Paul. As ever, when i was near to give up searching and decide to ask here, i made my last search on the net and found this . A dirty trick, but it seems to work for me. Something related to SharePoint as you stated as well.
Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic