Cinnamon/kotaemon

[BUG] File preview not working if it's not locally

Abner77 opened this issue · 1 comments

Description

Hi. The link that the system creates when showing the results and the pdf linked to the results appears to be pointing to for example data-src="/file=C:\kotaemon3\ktem_app_data\gradio_tmp\f7b3d4d27e3d5e5656bf4ccfb0d5de3f45a6654d\PRA-02007-Cambio de Departamento - Sistemas.pdf" which fails in case you are accesing the kotaemon app remotely from other host...... It's supposed to be used always locally or Am I doing something wrong?

Thanks.

Reproduction steps

1. Host kotaemon in a server
2. access from other computer using http://domainname or ip/:port 
3. Do some question that gets the answer by some pdf uploaded
4. Click preview, see error {data:not found}

Screenshots

![DESCRIPTION](LINK.png)

Logs

Browsers

No response

OS

No response

Additional information

No response

it might be the setup when behind an inverse proxy, I have changed a javascript in my project n the chat page to change the source of the links to pdf documents so they open directly in browser as pdf is supported by pretty much all. pdf-js is not needed in my case.