Function ContentType in phpfn.php is returning the wrong content type for word templates dotx (and I expect, xltx).
For dotx it returns ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’, which is the content type for docx. Correct type is ‘application/vnd.openxmlformats-officedocument.wordprocessingml.template’. Actually, this is correctly set in the “MIME_TYPES” array in ewcfg.php, but ContentType() tries to identify the content type from actual file contents over its extension.
This is not a problem using Chrome for instance, but in Firefox it adds .docx when downloading filename (making it docname.dotx.docx), which will cause an error opening in MS Word.
For now, I added this line to the beginning of ContentType():
if ($fn != “”) return MimeContentType($fn);
…maybe this could be corrected in a coming version.