Page 1 of 1

Problems with special Characters in openkm / docker

PostPosted:Mon Jul 12, 2021 1:15 pm
by jlg
Hi,
we recently switched from openkm 6.3.2 (windows installer, hsqldb) to openkm 6.3.9 (docker, mysql). Eveything works fine expect the file import where we are missing a couple of files having ampersands (R&D.pdf), etc.) in their filenames.

Exported Files (From Admin Panel):
Code: Select all
-rw-r----- 1 root      root          0 Jul 12 13:52 'R&D.pdf'
-rw-r----- 1 root      root        663 Jul 12 13:52 'R&D.pdf.okm'
Code: Select all
nano 'R&D.pdf.okm'
{"uuid":"fec594d8-2c52-4f21-8632-23fdbbbb2b55","author":"okmAdmin","name":"R\u0026amp;D.pdf","path":"/okm:root/R\u0026amp;D.pdf",...
The problem is the difference between the filename and their database entry and can be solved by renaiming the files to "R\u0026amp;D.pdf" and "/okm:root/R\u0026amp;D.pdf" as stored in the database. After that the import works and the filename in openKM Desktop is correct 'R&D.pdf'. But if the file is downloaded its download name is 'R&D.pdf'. The Problem is Edit and Update of this file only works with this filename. Using a file named 'R&D.pdf' throws a file not found error.

This behaviour can simply be reproduced by starting openkm via docker
Code: Select all
docker run --name openkm-ce -p 8080:8080 openkm/openkm-ce
- Login
- add document 'R&D.pdf'
- edit 'R&D.pdf' (download filename is 'R&D.pdf')
- update 'R&D.pdf' (using file with original filename throws file not found error)
- update 'R&D.pdf' (using downloaded file with filename 'R&D.pdf' works)

I think tomcat didn't correctly en- or decoded the filenames. I've tried to add the tag URIEncoding="UTF-8" to all connectors in my server.xml and enable the setCharacterFilter ind web.xml as explained here https://javavids.com/video/apache-tomcat-utf-8 but without any changes.

Hopefully someone can help me with this Issue.

Best regards
jlg

Re: Problems with special Characters in openkm / docker

PostPosted:Sun Jul 18, 2021 10:32 am
by jllort
* The web.xml should not be changed.
* HSQLDB database should not be used in production ( use MySQL, MariaDB, etc.. )

I have done some test and in the screenshots will see the results:
Selección_046.png
Selección_046.png (59.77 KiB) Viewed 8106 times
Selección_047.png
Selección_047.png (30.91 KiB) Viewed 8106 times
Selección_048.png
Selección_048.png (91.3 KiB) Viewed 8106 times
May be it is a bug, please add the issue at https://github.com/openkm/document-mana ... tem/issues and in the content please share the link of this post

Re: Problems with special Characters in openkm / docker

PostPosted:Fri Aug 13, 2021 3:46 pm
by SamMacLeod
Same bug, i will try to describe it.

Re: Problems with special Characters in openkm / docker

PostPosted:Sat Aug 14, 2021 8:04 am
by jllort
Ok, Anyway use regular database like mysql, postgresql .... do not try with hsql should never be used for production environments. If error persist explain with more detail. If you are sure it is a bug, register at https://github.com/openkm/document-mana ... tem/issues

Re: Problems with special Characters in openkm / docker

PostPosted:Tue Aug 17, 2021 6:45 am
by jlg
Hi, i have allready created an issue with a description and it has been added to the next milestone. See https://github.com/openkm/document-mana ... issues/298