webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 419 forks source link

ODT files not opening #85

Open socialweb opened 10 years ago

socialweb commented 10 years ago

I've been trying to show an ODT file without success. PDF shows fine, just ODT the main problem. Is there anything else I need to do to show this ODT file?

kossebau commented 10 years ago

It should just work with ODT as it works with PDF (only requirement still: filename extension needs to be matching, so be ".odt" for ODT files). Do you see any error message in the browser console? If there is no private data in the documents you have problems with, could you perhaps send the file(s) to friedrich@kogmbh.com, so I can test it myself and see where a problem might be?

socialweb commented 10 years ago

Hi kossebay!

Thanks for replying me!

There's no error shown in the browser console, and viewerjs just says "Loading /docs/OpenDocument-v1.2.odtt"

The document I've been testing on is the sample document at viewerjs.org:

http://viewerjs.org/ViewerJS/#/OpenDocument-v1.2.odt

But it doesn't work. PDF loads fine.

kossebau commented 10 years ago

Strange. Can you see if the file "/docs/OpenDocument-v1.2.odt" is actually served by the webserver, either in the logs of the server or e.g. in Chromium in the "Network" tab of the Developer tools? Or by just trying to access it directly, "http://yourhost:yourport/docs/OpenDocument-v1.2.odt"? WebODF/ViewerJS are currently not perfectly handling non-existing/not-served documents and just stopping like that. Perhaps the filesystem rights are not correct?

socialweb commented 10 years ago

Yes, the "/docs/OpenDocument-v1.2.odt" is served by the Webserver, the test pdf file is in the same directory as well, and it loads without issue.

I used the console and the debugger. I tried to access it directly and nothing happened.

Permissions for the file and folder are 777 (same as PDF).

SuYeeHlaing commented 9 years ago

I also encounter this issue..... <%--Libre_Word--%> < a href="/ViewerJS/#../testfiles/OpenDocument-v1.2.odt">Libre_Word< / a > < iframe id="Iframe2" src="/ViewerJS/#../testfiles/OpenDocument-v1.2.odt" width='400' height='300' allowfullscreen webkitallowfullscreen > < / iframe >

I added odt file to iframe.....it shows only Loading testfiles/OpenDocument-v1.2.odt capture Only pdf and ods files are working..... hope ur reply asap thank you

kossebau commented 9 years ago

@socialweb, you said:

I used the console and the debugger. I tried to access it directly and nothing happened.

What do you mean with "nothing happened"? So the webserver does not deliver the file at all? (so it is a problem outside ViewerJS?)

kossebau commented 9 years ago

@SuYeeHlaing, if you try <a href="/testfiles/OpenDocument-v1.2.odt">OpenDocument-v1.2.odt</a> and click on the link "OpenDocument-v1.2.odt" when browsing the html file, does the browser successfully download the file?

kunasharma commented 6 years ago

How to see a local odt file in the viewer?

I tried one online file and that failed to load.

https://viewerjs.org/ViewerJS/#../http://file-examples.com/wp-content/uploads/2017/10/file-sample_100kB.odt

ajayvarghese003 commented 5 years ago

Getting this same issue. PDF is working fine. but not ODT file. ODT File has the same permissions and accessibility as the PDF file. I can see a request made in developer tools. It's delivering ODT File without any error. Even console looks clear for me. We tried with the sample documents present in ViewerJS website. Same case happening for that as well.

All I got is different console logs for both document, please find them below.

Console for PDF (which is working fine.)

screen shot 2018-11-23 at 1 48 16 pm

Console for ODT (which is not working.)

screen shot 2018-11-23 at 1 45 54 pm