How to open .odt file as template in web application?

Hello, i just try collabora online and it look so cool.
I want to use collabora to editing file in my own web application. How to setting up in my project, to open my file .odt that i have create before from Open Office (desktop). So another user can edited it too via web application. I have try using collabora with reactjs and express, and i use docker to run collabora server.

thanks for your help

1 Like

Hi @abk,

Welcome to the forum! :slight_smile:

So, if I’m understanding you correctly:

  • You already have an ODT document.

and then you want to:

  • Share this ODT over the internet to someone.
  • + Read/Edit a document together in the browser.

Yep. That’s a lot of what Collabora Online was made for! :slight_smile:

i use docker to run collabora server.

Great.

Did you follow the instructions listed on these 2 pages?

https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html

What exact things are you having trouble with? What have you tried so far?


Side Note:

i have create before from Open Office (desktop).

Did you know that LibreOffice is the same as OpenOffice, but now has 12+ more years of bugfixes/updates? :stuck_out_tongue:

Definitely upgrade to LibreOffice 7.5.4 (or Collabora Office 22.05), you won’t regret it!

thanks for your reply

what i mean is, can i integrate the collabora to my personal web application base on nodejs (not on owncloud and nextcloud)?

and where i can get reference to implement it? because im not find reference, how configure to open my .ODT document with collabora in nodejs

If you want to integrate COOL in your application you can follow: How to integrate — SDK https://sdk.collaboraonline.com/ documentation

1 Like

yes thanks, i have done follow thats step unitl show and edit “hello word” document. But, I mean, what should i do if i want to open file from the server like file .odt or .docx. because in example it just return string “helo word”. How to return and what format if we want to open file .odt or .docx?

ok, I finally figured it out solution for this problem.

this is the just the simple code to show file like .odt or .docx in wopi host

const fs = require(‘fs’)

const data = fs.readFileSync(‘filename.odt’, { flag: ‘r’ });

res.send(data)

1 Like

Fantastic! Thanks for posting the solution, abk. :slight_smile:

How did you find that solution? Was it mentioned somewhere in the documentation? Or were you just messing around with the code on your own?