It did work for him. But when a powerpoint was server
with a
word mime,
the browsers were unable to open the right application. This
is because
Office documents are so similar that file can detect which
office type is.
I remember someone posted here a hack changing the mime of
Office files
depending on the extension.
To quote the email I had sent about this previously:
"Putting:
application/msword doc xls ppt
works for getting the files into the wiki, but causes the wrong mime
types to be sent back when the user accesses the file.
What I've found to work (and please let me know if there is a better
way), is to send the correct mime type out depending on the extension:
--- MimeMagic.php.old 2008-01-29 16:15:59.000000000 -0600
+++ MimeMagic.php 2008-01-29 16:15:35.000000000 -0600
@@ -497,6 +497,21 @@
}
+ //BEGIN CUSTOMIZATION
+ # New excel files have the same magic number as msword
files
+ if ( $mime == "application/msword" ) {
+ $i = strrpos( $file, '.' );
+ $e = strtolower( $i ? substr( $file, $i + 1 ) :
'' );
+
+ if ( $e == "xls" ) {
+ $mime= "application/vnd.ms-excel";
+ }
+ if ( $e == "ppt" ) {
+ $mime= "application/vnd.ms-powerpoint";
+ }
+ }
+ //END CUSTOMIZATION
+
if ( isset( $this->mMimeTypeAliases[$mime] ) ) {
$mime = $this->mMimeTypeAliases[$mime];
}
"
Notice that this only works if you are using img_auth.php, as the file
is otherwise being delivered by apache, which will provide the incorrect
mime type to the user.
V/r,
Ryan Lane