The accept attribute of cffile doesn't work with Microsoft Word DOCX files| View in Tracker
Components: File Management
Found In Build/Fixed In Build: Final / CF11 Update5
Priority/Frequency: Major / All users will encounter
Locale/System: English / Platforms All
Vote Count: 2
Problem Description: I have noticed that you can not use the accept attribute to limit a script to only allow uploading of docx files. If you eliminate the accept attribute, docx files from MS Office and LibreOffice are reported by the results variable as 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'. If you set the accept attribute to equal "application/vnd.openxmlformats-officedocument.wordprocessingml.document", it rejects the file from LibreOffice, saying that it is an "application/zip" file. When you try to upload the file from MS Office 2010, it does accept the file but results variable reports the uploaded file as being "application/x-tika-ooxml". Steps to Reproduce: I used the same test script (https://gist.github.com/steinbring/8482307) on both CentOS/Apache/CF10 Standard and localhosted CF10 on Win7. I used two test files. One was created in MS Office 2010 and one was created in LibreOffice 22.214.171.124. In both apps, I saved the test file as a docx file. Actual Result: In the case of the LibreOffice file, the accept attribute wrongfully blocked the file. In the case of the MS Office file, it accepted the file but the MIME type of the uploaded file was reported incorrectly. Expected Result: I expected it to accept both files successfully. Any Workarounds: The only workaround I can think of is to not use the accept attribute. It looks like cfdirectory does reliably report the correct MIME type. You could blindly upload everything and anything and then check the file for correct / expected content after the fact. ----------------------------- Additional Watson Details ----------------------------- Watson Bug ID: 3695879 External Customer Info: External Company: External Customer Name: _CoderJoe_ External Customer Email: External Test Config: My Hardware and Environment details: CentOS/Apache/CF10 Standard and localhosted CF10 on Win7. The OOo extension is installed on the CentOS box. It is not installed on the windows 7 box.