3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
257 stars 143 forks source link

[Bug]: Dificulties showing Media (images) that are uploaded using Lizmap #4826

Open abodsalas opened 1 day ago

abodsalas commented 1 day ago

What is the bug? (in English)

Good day. First I want to congratulate the Lizmap team for developing such a great and usefull software. It's awesome.

Second, I having issues trying to display uploaded images using the /media folder described in Lizmap's documentation. https://docs.lizmap.com/3.6/en/publish/configuration/media.html

The images are uploaded to the correct location, however they are not shown in the popup.

image

I finally detectaed that although my Lizmap .env file defines the port as 80 (LIZMAP_PORT=10.20.1.12:80), in the web browser, the images are liked to port 8080. When I right clic the broken image link in the attribute popup, the link is: http://10.20.1.12:8080/index.php/view/media/getMedia?repository=publicidad03092024&project=publicidad_03-09-2024&path=..%2Fmedia%2Fimages%2Fimage004.png

The information of my setup is: Information, Lizmap Web Client: Version: 3.6.14 Date: 2024-07-04 URL in the QGIS desktop plugin: http://10.20.1.12:8080/

Information, QGIS Server: Number: 3.28.13 Name: Firenze

Information, Plugins: atlasprint: 3.4.1 Lizmap server: 2.9.4 wfsOutputExtension: 1.8.0

By the way, if I change in docker-compose.yml

Please help. Thank you very much.

Steps to reproduce the issue

Try to upload images using Lizmap's image folder, using a port different than 8080.

Versions, safeguards, check summary etc

Versions :

List of safeguards :
* Mode : normal * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : no

Check Lizmap plugin

Operating system

Ubuntu 24.04

Browsers

Chrome

Browsers version

Versión 129.0.6668.60

Relevant log output

A span tag was parsed inside of a <select> which was not inserted into the document. This is not valid HTML and the behavior may be changed in future versions of chrome. <option value=​"4326" selected=​"selected">​EPSG:4326​</option>​slotUnderstand this warning
map:1 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
Gustry commented 13 hours ago

Compare to your current generated URL

http://10.20.1.12:8080/index.php/view/media/getMedia?repository=publicidad03092024&project=publicidad_03-09-2024&path=..%2Fmedia%2Fimages%2Fimage004.png

What would be the working URL ? Related to your QGIS project location, is the path ../media/images/image004.png existing ?

So http://10.20.1.12:8080/ is working in QGIS, right ?

abodsalas commented 7 hours ago

Hello Gustry. 1) The currently generated URL is: http://10.20.1.12:8080/index.php/view/media/getMedia?repository=publicidad03092024&project=publicidad_03-09-2024&path=..%2Fmedia%2Fimages%2Fimage004.png

It returns: HTTP ERROR 404 Not Found

If I manually change it to port 80: http://10.20.1.12:80/index.php/view/media/getMedia?repository=publicidad03092024&project=publicidad_03-09-2024&path=..%2Fmedia%2Fimages%2Fimage004.png

The image loads correctly.

2) The path and file "../media/images/image004.png" exists.

The issue is that I have Lizmap configured to port 80, yet the image URL generated in the Lizmap popup is directed to the 8080 port.