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

**URL:** <https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880>\
**Category:** User Support\
**Created:** [June 14, 2023, 7:13am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880 "2023-06-14T07:13:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![abk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/abk/32/781_2.png) [@abk](https://forum.collaboraonline.com/u/abk)\
**Post date:** [June 14, 2023, 7:13am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/1 "2023-06-14T07:13:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tex](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@Tex](https://forum.collaboraonline.com/u/Tex)\
**Post date:** [June 15, 2023, 4:33am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/2 "2023-06-15T04:33:18Z")

</div>

Hi @abk,

Welcome to the forum! 🙂

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! 🙂

> i use docker to run collabora server.

Great.

Did you follow the instructions listed on these 2 pages?

> **[Setting up and configuring collabora/code Docker image - Collabora Office and...](https://www.collaboraoffice.com/code/docker/)**
>
>   Learn all the ins and outs of CODE How to grab the CODE image from Docker image Collabora Online Development Edition (CODE) is available as a Docker image from Docker Hub. Follow step-by-step instructions.

[https://sdk.collaboraonline.com/docs/installation/CODE\_Docker\_image.html](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](https://www.libreoffice.org/) is the same as OpenOffice, but now has 12+ more years of bugfixes/updates? 😛

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

---

<div class="post-metadata">

**Author:** ![abk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/abk/32/781_2.png) [@abk](https://forum.collaboraonline.com/u/abk)\
**Post date:** [June 15, 2023, 5:48am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/3 "2023-06-15T05:48:59Z")

</div>

> [@Tex](#):
>
> [CODE Docker image — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html)

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

---

<div class="post-metadata">

**Author:** ![rash419](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/rash419/32/1157_2.png) [@rash419](https://forum.collaboraonline.com/u/rash419)\
**Post date:** [June 15, 2023, 10:40am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/4 "2023-06-15T10:40:00Z")

</div>

If you want to integrate COOL in your application you can follow: [How to integrate — SDK https://sdk.collaboraonline.com/ documentation](https://sdk.collaboraonline.com/docs/How_to_integrate.html)

---

<div class="post-metadata">

**Author:** ![abk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/abk/32/781_2.png) [@abk](https://forum.collaboraonline.com/u/abk)\
**Post date:** [June 19, 2023, 2:10am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/5 "2023-06-19T02:10:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![abk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/abk/32/781_2.png) [@abk](https://forum.collaboraonline.com/u/abk)\
**Post date:** [July 3, 2023, 3:35am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/6 "2023-07-03T03:35:58Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Tex](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@Tex](https://forum.collaboraonline.com/u/Tex)\
**Post date:** [July 6, 2023, 4:16am UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/7 "2023-07-06T04:16:33Z")

</div>

Fantastic! Thanks for posting the solution, abk. 🙂

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?

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [August 6, 2024, 2:24pm UTC](https://forum.collaboraonline.com/t/how-to-open-odt-file-as-template-in-web-application/1880/8 "2024-08-06T14:24:49Z")

</div>


