Office 2007 format files (.docx, .pptx, .xlsx) gets courrepted while downloading from TWiki implementation.
Following is exploration:
Attachment, say test.docx is attached at Sanbox on
ExperiMent topic. Then the attachment can be download by following two methods:
[1]. use URL http://exampletwiki.com/twiki/pub/Sandbox/ExperiMent/test.docx
[2]. use URL http://exampletwiki.com/twiki/bin/viewfile/Sandbox/ExperiMent?rev=;filename=test.docx
The method [1] can be fixed by adding following to Webserver configuration (e.g. httpd.conf in case of apache)
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Method [2] is not fixed. In method the TWiki picks up MIME types from file defined in the variable <nop>$TWiki::cfg{MimeTypesFileName} which is generally set to TWIKI_ROOT/data/mime.types file.
After adding following section-browsers do recognize attachments as office2007 files but still generate errors while opening the files.
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.ms-word.document.macroEnabled.12 .docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
application/vnd.ms-powerpoint.template.macroEnabled.12 potm
application/vnd.openxmlformats-officedocument.presentationml.template potx
application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/vnd.ms-excel.addin.macroEnabled.12 xlam
application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
application/vnd.ms-excel.template.macroEnabled.12 xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Other observation is: I have done some experiments with LWP module,
my $url = ....
my $browser = LWP::UserAgent->new();
my $response = $brv->get($url);
my $content = $response->content();
print $content;
The above code produces the correct content (the correct docx file).
But experienced the issue in browsers like Firefox, IE (version 6), Chrome.
Method [2] has definitely a Bug for Office2007 MIME types.
--
TWiki:Main/SopanShewale - 13 Nov 2008
The recent code from trunk do not face this issue.
I have just updated the mime.types file to support .docx, .pptx etc suffixes -checkin the file into trunk.
Closing the Bug.
--
SopanShewale - 14 Nov 2008
Reopening the bug
- Need to sort mime.types
- Need to modify ".docm" to "docm" from mime.types file
and closing the Bug now
--
SopanShewale - 18 Nov 2008