Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Wiki.tetrain.com Runbook
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 9.2 Extend further: ppt, pptx, tiff, bmp, docx, xlsx, ps, odt, ods, odp, odg === Before touching config, checked whether MediaWiki core already knows how to map each extension to a MIME type (the actual mapping source in this version is <code><nowiki>includes/libs/mime/MimeMap.php</nowiki></code> β '''not''' a flat <code><nowiki>mime.types</nowiki></code>/<code><nowiki>mime.info</nowiki></code> file): <pre> <nowiki> grep -iE "'docx'|'xlsx'|'pptx'|'ppt'|'odt'|'ods'|'odp'|'odg'|'tiff'|'tif'|'bmp'|'ps'" \ /var/www/wiki/includes/libs/mime/MimeMap.php </nowiki> </pre> Confirmed: every one of these was already correctly mapped (e.g. <code><nowiki>'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => [ 'docx' ]</nowiki></code>, <code><nowiki>'image/tiff' => [ 'tiff', 'tif' ]</nowiki></code>, <code><nowiki>'application/postscript' => [ 'ai', 'eps', 'ps' ]</nowiki></code>, etc.) β no core patching needed, only the extensions allowlist. <pre> <nowiki> cp /var/www/wiki/LocalSettings.php /var/www/wiki/LocalSettings.php.bak.$(date +%Y%m%d%H%M%S) </nowiki> </pre> Edit the line from 9.1 to: <pre> <nowiki> $wgFileExtensions = array_merge( $wgFileExtensions ?? [ 'png', 'gif', 'jpg', 'jpeg' ], [ 'pdf', 'ppt', 'pptx', 'docx', 'xlsx', 'tiff', 'tif', 'bmp', 'ps', 'odt', 'ods', 'odp', 'odg' ] ); </nowiki> </pre> (Legacy <code><nowiki>doc</nowiki></code>/<code><nowiki>xls</nowiki></code> deliberately '''not''' added β not part of what was requested.) '''Verify''': same <code><nowiki>siprop=fileextensions</nowiki></code> API check as 9.1; confirmed all 11 new extensions present, no httpd error-log entries after reload. '''Known limitation, disclosed rather than silently shipped''': TIFF and PS files upload fine but render '''no thumbnail preview''' β the site's bitmap pipeline is GD, not ImageMagick (<code><nowiki>$wgUseImageMagick = false</nowiki></code>, unchanged from Phase 5), GD has no TIFF decoder, and no PostScript handler extension is installed (<code><nowiki>ls extensions/ | grep -iE 'tiff|postscript'</nowiki></code> β empty). Both formats behave like Office documents already do (download-only, generic file icon). Not fixed in this pass β flagged to the client as an open choice (add a TIFF/PS handler vs. accept upload-only) rather than guessed at. ----
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)