After debugging why pptx files were not able to be opened after passing through our TWiki installation, I finally noticed that there was one extra byte on the file after downloading it from our TWiki.
TWiki was adding a trailing newline to the file via the 'viewfile' script. Apparently all our file formats could handle it except pptx.
I found a HERE document which wasn't do anything to deal with the implied trailing newline, as described here:
http://www.stonehenge.com/merlyn/UnixReview/col12.html
Patch follows:
--- lib/TWiki/UI/View.pm.orig 2009-03-09 18:40:05.000000000 -0700
+++ lib/TWiki/UI/View.pm 2009-08-18 20:14:14.000000000 -0700
@@ -421,15 +421,15 @@
my $fileContent = $session->{store}->readAttachment(
$session->{user}, $webName, $topic, $fileName, $rev );
my $type = _suffixToMimeType( $session, $fileName );
my $length = length( $fileContent );
my $dispo = 'inline;filename='.$fileName;
- print <<HERE;
+ print substr(<<HERE,0,-1);
Content-type: $type
Content-length: $length
Content-Disposition: $dispo
$fileContent
HERE
}