Download it now!
Bug 90903 - FILESAVE: OOXML files saved by LO do not detect with Linux file command
Summary: FILESAVE: OOXML files saved by LO do not detect with Linux file command
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
(earliest affected) release
Hardware: All All
: medium minor
Assignee: Not Assigned
Depends on:
Reported: 2015-04-28 06:40 UTC by Dan
Modified: 2019-12-03 14:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

file-5.14/magic/Magdir/msooxml (1.80 KB, text/plain)
2015-04-28 06:40 UTC, Dan
file-5.19/magic/Magdir/msooxml (1.75 KB, text/plain)
2015-04-29 06:18 UTC, Dan

Note You need to log in before you can comment on or make changes to this bug.
Description Dan 2015-04-28 06:40:11 UTC
Created attachment 115148 [details]

DOCX and XLSX files saved with MS Office 2007 / 2010 correctly detect using the UNIX file command. Saved with LO, these detect as standard Zip files.

$ file *.*x
SavedWith2007.docx:    Microsoft Word 2007+
SavedWith2007.xlsx:    Microsoft Excel 2007+
SavedWithLO.docx:      Zip archive data, at least v2.0 to extract
SavedWithLOLinux.docx: Zip archive data, at least v2.0 to extract
SavedWithLOLinux.xlsx: Zip archive data, at least v2.0 to extract
SavedWithLO.xlsx:      Zip archive data, at least v2.0 to extract

Tested with LO on Windows and Linux.

My guess is that the files within the ZIP created by LO are not in the same order as MS Office.

Attached is the relevant source file from Ubuntu's 14.04 release, detailing the detection logic of the file command. (file 5.14)
Comment 1 raal 2015-04-28 18:56:11 UTC
works correct in ubuntu 15.10 and LO Version:
Build ID: f0edb677f09ad338e22ac3b5d91497b4479e0b3c
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-04-27_00:34:40

LO437.xlsx:                                 Microsoft OOXML
LO5.xlsx:                                   Microsoft OOXML
off2010.xlsx:                               Microsoft Excel 2007+

file --version

File saved from LO are detected as Microsoft OOXML. Closing as worksforme.
Comment 2 Dan 2015-04-29 06:17:57 UTC
Hi Raal,

Thanks for your quick reply and your efforts in further testing.

However, I find myself disagreeing with your eventual conclusion. I have looked at the version of the file command you used, and the deficiency in LibreOffice has been (partially) worked around by the newer file command. It still shows a discrepancy between MS and LO DOCX files which is causing interoperability problems. The newer file command is still unable to determine the type of file (ie. Word, Excel) as your testing shows.

The new version of the "magic" msooxml file was downloaded from here and I have attached it for convenience.

Of particular note is the comment near the top of the file:
#   archive.  The first member file is normally "[Content_Types].xml".
#   but some libreoffice generated files put this later. Perhaps skip
#   the "[Content_Types].xml" test?

While I'm sure we both agree this is a relatively minor issue, it does show a deficiency in LibreOffice. It leaves me wondering if it would be an easy fix, but I have no knowledge of the LO codebase.

Either way, I would like the status changed from RESOLVED/WORKSFORME as I believe the bug is still valid. Whether it's worth fixing isn't for me to say, but clearly there is a problem.
Comment 3 Dan 2015-04-29 06:18:56 UTC
Created attachment 115171 [details]
Comment 4 raal 2015-04-29 06:25:22 UTC
Setting to unconfirmed for others comment.

The main point as I understand is:
#   archive.  The first member file is normally "[Content_Types].xml".
#   but some libreoffice generated files put this later.

Does ooxml file format specify order of files in zip container?
Comment 5 Dan 2015-04-29 06:54:50 UTC
Hi Raal, thanks for changing the status :)

I'm a little out of my depth now, but I had a look at the ECMA-376 4th edition Part 2 available here:,%20Fourth%20Edition,

On page 107 (PDF page 115) ID S2.5 is possibly relevant: "The package implementer should store pieces in their natural order for optimal efficiency." although this is only a recommendation.

While Microsoft rarely sets the benchmark in terms of efficiency, I would tend to agree in this isolated incident that the file describing the other files in an archive should appear first :)

On page 112 (PDF 120) ID O3.1 also seems somewhat relevant.
Comment 6 Andreas Schlager 2015-11-19 14:04:21 UTC
I can reproduce the problem with Word .docx Files saved with the latest dev build libreoffice-5-0~2015-11-16_13.06.56_LibreOfficeDev_5. on Debian 8.0:

$ file *x
Excel.xlsx:      Microsoft OOXML
PowerPoint.pptx: Microsoft PowerPoint 2007+
Word.docx:       Zip archive data, at least v2.0 to extract

Excel/PwrPnt seems not to be affected of this problem.
Comment 7 QA Administrators 2017-01-03 19:35:31 UTC Comment hidden (obsolete, spam)
Comment 8 QA Administrators 2019-12-03 14:37:28 UTC
Dear Dan,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat:

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team