Suppose I want to add an .ods (or an .xlsx) as a source file. I go to the Manage Project interface, type 'test.ods' into the 'Source filename' textbox, and hit tab to get the default Page it will be uploaded to. Desired behavior is that the default Page name is e.g. File:DebugPage$test.ods ; actual behavior is that the default page name is DebugPage/test.ods . This is (a) hard to spot and confusing to newbies, and (b) means that when you click on the link to download that file, rather than seeing a File: interface with a download link, you see a page full of gibberish with no obvious way to download it. My guess is that somewhere what to do is being chosen based on mime type, since e.g. .xls files do the correct thing, while .ods and .xlsx are xml. Perhaps there could be (or is already?) a configuration variable where the list of types treated as File:s can be specified.
Anonymous
In a standard WW installation you can do this by adding to $wwImageExtensions:
$wwImageExtensions[] = "ods";
This is normally the best way to do it, because WW is normally configured to assume unknown file types should be uploaded as text. If you prefer to assume binary by default, set
$wwUploadAsImageByDefault = true;
and then you create exceptions by specifying which are text files:
$wwImportTextExtensions[] = "bat";
See the comments in WorkingWiki.php and ProjectEngine/ProjectEngine.php for more information on config variables.
It doesn't use mime types, just filename extensions. There's another bug ticket related to this:
"WW sometimes puts binary file contents in the output page"
https://sourceforge.net/tracker/index.php?func=detail&aid=3204802&group_id=366300&atid=1527385
[note: the variable controlling which types are uploaded as binary is actually $wwImportImageExtensions, which is normally set equal to $wwImageExtensions. The primary function of $wwImageExtensions is to control which files are served verbatim by Special:GetProjectFile, rather than being presented as a wiki page containing a link or a source code listing. Binary file types should generally be on both lists. Add to $wwImageExtensions before the require_once('WorkingWiki.php') command to get the correct result.]
Hm: neither of these methods works for me: changing $wwImageExtensions or setting $wwUploadAsImageByDefault, either before or after the require_once does not change the behavior. Adding to $wwImportImageExtensions does work, however.
I see... I'll look into that.