Community Support for OpenDocMan (Deprecated)

Full Version: Can add .xlsm, cannot check in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

2008-12-10 10:01:46 PST
I think I might have found a defect. I can add a file with the extension xlsm. I can check it out. However, if I try to check it back in, I get an error that the MIME type of the document is not supported.

2008-12-10 10:10:25 PST
Does your system's mimetype file (/etc/mime.types, for example) contain the definition for xlsm?

2008-12-10 11:29:17 PST
The config.php file contains this mime-type:



2008-12-10 12:47:05 PST
What OS are you running?

2008-12-10 14:10:58 PST
Windows Server 2003

Apache 2.2.6
MySQL 5.0.45
PHP 5.2.4

2008-12-11 05:39:59 PST
(First... please reply to the right message, so future readers can see the logical flow of this conversation. Thanks!)

I have no experience with Windows. Linux, and other UNIX, systems have an /etc/mime.types file that lists the MIME types. The ODM mimetypes.php file will read this, or if it's not found use the ODM defaults. The ".xlsm" extension is not listed as an ODM default. You have two options:

Best... patch mimetypes.php to read the Windows version of /etc/mime.types. This fixes your problem, but also fixes it for all Windows users and gives some future proofing.

Almost as good... patch mimetypes.php to add ".xlsm". This also fixes your problem for all Windows users, but does offer the same future proofing.

In either case, in the spirit of OSS, please contribute your patches back to the ODM distribution.

2008-12-11 11:08:54 PST
I've added support for some Office 2007 document types and older MS Office document types that were not supported.

Here are the lines I added to mimetypes.php:

MS Excel prior to Office 2007:

$mimetypes['xla'] = 'application/';
$mimetypes['xlc'] = 'application/';
$mimetypes['xlm'] = 'application/';
$mimetypes['xlt'] = 'application/';
$mimetypes['xlw'] = 'application/';

MS Excel from Office 2007:

$mimetypes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
$mimetypes['xlsm'] = 'application/';
$mimetypes['xltx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
$mimetypes['xltm'] = 'application/';
$mimetypes['xlsb'] = 'application/';
$mimetypes['xlam'] = 'application/';

MS Project prior to 2007:

$mimetypes['mpp'] = 'application/';
$mimetypes['mpc'] = 'application/';
$mimetypes['mpt'] = 'application/';
$mimetypes['mpx'] = 'application/';
$mimetypes['mpw'] = 'application/';

MS Powerpoint prior to Office 2007:

$mimetypes['pot'] = 'application/';
$mimetypes['pps'] = 'application/';
$mimetypes['ppz'] = 'application/';

MS Powerpoint from Office 2007:

$mimetypes['pptx'] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
$mimetypes['pptm'] = 'application/';
$mimetypes['ppsx'] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';
$mimetypes['ppsm'] = 'application/';
$mimetypes['potx'] = 'application/vnd.openxmlformats-officedocument.presentationml.template';
$mimetypes['potm'] = 'application/';
$mimetypes['ppam'] = 'application/';
$mimetypes['sldx'] = 'application/vnd.openxmlformats-officedocument.presentationml.slide';
$mimetypes['sldm'] = 'application/';

MS Word from Office 2007:

$mimetypes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
$mimetypes['docm'] = 'application/';
$mimetypes['dotx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';
$mimetypes['dotm'] = 'application/';

I made changes to the mime.types in the conf folder of my Apache installation to add support for the mime types I added to mimetypes.php if they were not already there. This fixed my problem.

Is there anybody still has similar issue. I uses the opendocman, but cannot add document with *.xlsm format, after browsing this web, I add the line as below in the file of mimetypes.php

'xlsm' => array('application/'),

inside the array of $mimetypes = array(); as other file types.

but after that and enter the web again the issue is still there- I cannot add *.xlsm file into, the system told me

MIMETYPE: application/ Failed

That file type is not currently supported. Please upload a document conforming to an allowed file type or have the administrator add the missing mime-type.

any suggestions from any body?