I am writing an application using ColdBox / ORM. For my problem, I am attempting to have HTML code rendered / downloaded with an .docx file extension rather than a .doc file extension. When downloading the rendered document and trying to open it, I receive a popup saying
Word found unreadable content in ***********. Do you want to recover the contents of this document?
.cfm page
In the file I am trying to have rendered, there is the following in the html tag
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40"
.cfc page
original code
event.renderData(data=fileReadBinary('fileName.doc')
, contentType='application/msword'
, isBinary=true);
new code
event.renderData(data=fileReadBinary('fileName.docx')
, contentType='application/vnd.openxmlformats-officedocument.wordprocessingml.document'
, isBinary=true);
My expected output is to have the contents of the .cfm
file rendered in a .docx
file and to be able to open and view it. What actually happens is I get some popup saying "Word found unreadable content in ***********
. Do you want to recover the contents of this document?" With buttons for yes / no. Even when choosing yes, I do not see the contents of the file. However, the current code successfully renders as a .doc
file which I can view / open.