Closed pcav closed 2 years ago
Sorry @pcav I don't understand the issue. Libreoffice wants to read a plain ODS file, not a zipped ODS. Why do you want a zipped ODS?
Maybe I'm missing something?
ODS format is a zip file that contains an XML and other data like images.
The ODS file is generated by QGIS QgsVectorFileWriter.
Yes, but I tried on Lizmap, I have an ODS file and it's working well in LibreOffice. I don't have any zipped file.
Are you sure it wasn't your file explorer which opening the file with the archive software?
so you can open an unzipped ODS file from LibreOffice? In my case it opened as xml.
I'm not "unzipping" the ODS file, everything works fine.
my_layer.ods
file when I select ODS
.Open with
my archive software, yes indeed I can see XML files inside. But you shouldn't to that. It's like opening a QGZ file with your archive software.@pcav Does it happen with other ODS files?
OK, your explanation makes sense to me. The problem stems from the fact that the browser by default suggests to open the ods with LO. Thanks.
Ok, so I just checked the MIME Type on the file:
~/dev/qgis/server_plugin $ file --mime-type -b /home/etienne/Téléchargements/export_value_map.ods
application/zip
So indeed, your webbrowser is following the Mime Type to choose the archive software.
My firefox is following the extension .ods
and doesn't open my archive software.
The content type in the plugin is well defined:
I didn't check if QGIS Server can set the correct MIME Type. Maybe @dmarteau has an idea?
Ok, so I just checked the MIME Type on the file:
~/dev/qgis/server_plugin $ file --mime-type -b /home/etienne/Téléchargements/export_value_map.ods application/zip
And on a ODS file from scratch created in LO:
~/dev/qgis/server_plugin $ file --mime-type -b /tmp/test_ods.ods
application/vnd.oasis.opendocument.spreadsheet
if I'm not wrong, this has been fixed ? (with #16)
Gentle ping @pcav
@Gustry the issue seems to be fixed on the user side. Firefox offers to open the file with LO, and the downloaded file can be opened directly.
The mimetype of the downloaded file is still:
application/zip
instead of:
application/vnd.oasis.opendocument.spreadsheet
In the response headers provided by QGIS Server or Lizmap you would find application/vnd.oasis.opendocument.spreadsheet
for content type. But between QGIS Server / Lizmap and the Browser there is some software that probably not recognize application/vnd.oasis.opendocument.spreadsheet
content type and change it to application/zip
because ODS is a zip file.
@rldhont I would consider it fixed, since the behaviour is correct on the user end. Thanks!
The MIME type is still indeed incorrect, but for the web browser, it seems alright indeed.
Apparently the exported ods file is unzipped, so it cannot be opened directly by LibreOffice.