Hello,
This issue is due to how mime types work. Files don't have mime types and they are identified by their file extensions (the mime types are set by file extensions in /etc/mime.types).
And a DOCX is a ZIP file so if your OS is reading the header to get the MIME TYPE it may get a generic MIME:
Zip archive data, at least v2.0 to extract
this is due to how the ZIP has been generated, using ZipArchive with PHP. If you extract the ZIP and compress the files using the zip command on Linux you may get other MIME TYPE:
Microsoft OOXML
or even:
Microsoft Word 2007+
And it may vary if the file has been generated with Word or LibreOffice.
All these files are opened correctly with Word (and also LibreOffice or OpenOffice).
The solution to this issue is to send the correct MIME type header when you send the DOCX, this is setting the Content-Type value. The API you're using should have an option to set a MIME TYPE manually or force it using a header from your server.
Regards.