I’ve been trying to work out the modifications needed to handle Office 2007 file attachments: docx, xlsx and pptx.
I’ve been working on modifications to a number of modules, testing with a docx file sent to me by someone who is using Word 2007. I have Office 2002.
In summary, I have found that some modified modules:
1. Can handle docx files correctly: xmail, news and liaise
2. Allow you to attach a docx file but you cannot open the file: xhelp and extcal
3. Do not allow you to attach a docx file: smartsection
mimetypesAccording to Microsoft (
http://technet.microsoft.com/en-us/library/ee309278.aspx) these are the mimetypes:
.docx - application/vnd.openxmlformats-officedocument.wordprocessingml.document
.xlsx - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.pptx - application/vnd.openxmlformats-officedocument.presentationml.presentation
xmail moduleModify include/mimetype.php.
Look for this statement:
"doc" => "application/msword",
Add these statements:
"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"ppt" => "application/mspowerpoint",
"pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"xls" => "application/msexcel",
"xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
You then go into xmail admin and select the required filetypes from the list of Allowed Mimetypes.
This modification allows you to attach a docx file and send the email. Once the email has been received, the user can open the docx file. If the user has a version of Office which is earlier than 2007, then the Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 file formats will be required to open the file. The important point is that this modification to xmail will do the trick.
news moduleYou can update the list of mimetypes in news admin by adding to the list under the heading: Enter authorized Mime Types for upload
application/msword
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/vnd.ms-excel
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.ms-powerpoint
application/vnd.openxmlformats-officedocument.presentationml.presentation
You can then attach a docx file to a news item. When you open the attached file, the file is converted by the Compatibility Pack and you can work with the file without any problems.
liaise moduleThe list of allowable file extensions is defined when you use a form element called File upload. In the list of Allowed filename extensions I entered this list:
doc|xls|ppt|docx|xlsx|pptx|pdf
You can then attach a docx file and submit the form. Once the email has been received, the user can open the docx file without any problems.
xhelp moduleYou can easily add new mimetypes by going into xhelp admin and updating the list of mimetypes. For example:
File Extension – docx
Application Type/Name - Word Document
Mimetypes - application/vnd.openxmlformats-officedocument.wordprocessingml.document
You can then attach a docx file. However, when you try to open the file, you get an error message:
This is a pre-release version of the Compatibility Pack and can open pre-release Office 2007 files only. Do you want to check for a newer version of the Compatibility Pack?
I have the latest version of the Compatibility Pack installed so this message suggests that there is something wrong with the mimetype.
extcal moduleModify the XOOPS file include/mimetypes.inc.php.
Look for:
"doc" => "application/msword",
Add:
"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
Look for:
"xls" => "application/vnd.ms-excel",
Add:
"xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
Look for:
"ppt" => "application/vnd.ms-powerpoint",
Add:
"pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
You then have to update the extcal module for the changes to be applied.
You can then attach a docx file to a calendar item. However, when you try to open the file, you get an error message:
This is a pre-release version of the Compatibility Pack and can open pre-release Office 2007 files only. Do you want to check for a newer version of the Compatibility Pack?
I have the latest version of the Compatibility Pack installed so this message suggests that there is something wrong with the mimetype.
smartsection moduleYou can easily add new mimetypes by going into smartsection admin and updating the list of mimetypes. For example:
File Extension – docx
Application Type/Name - Word Document
Mimetypes - application/vnd.openxmlformats-officedocument.wordprocessingml.document
When you try to attach a docx file to a smartsection item, you get an error message that says:
An error occured while uploading the File. mimetype must be shorter than 64 characters.
Questions1. What needs to be done to get smartsection to accept a docx file as a file attachment?
2. What needs to be done to get xhelp to work correctly?
3. What needs to be done to get extcal to work correctly?