I agree that being able to add the parameter does provide the flexibility, and this would still be present with my proposed change. The difference is that the site admin could define a list of file types that they wanted to force download by default. This would allow the admin control of how files are handled on their site file type by type, without a teacher having to be taught how to add the parameter extensions to their files.
Those teachers that had a specific case, that needed files to be downloaded that were by default not, could easily be shown the parameter for their needs. The amount of time required for me to change every single Microsoft Office link through out our whole Moodle install is completely unfeasible. (It would take days!!!) I think that this solution would prove a lot more useful, and could even be incorporated into the site config page, so that the admin can set the file types there that they want to be downloaded. (No need to go into the code!)
I am going to have a look at my PHP books tonight when I get home and brush up on regular expressions, as I am sure that I can get this to work, at least within the code.. Then I will look at incorporating it into the site config page...
I will keep you all posted.
Jon
____________________________________
Umm so thought this might work but it doesn't....

if ($mimeinfo == 'doc') {
$forcedownload = optional_param('forcedownload', 1, PARAM_BOOL);
} else if ($mimeinfo == 'xls') {
$forcedownload = optional_param('forcedownload', 1, PARAM_BOOL);
} else if ($mimeinfo == 'ppt') {
$forcedownload = optional_param('forcedownload', 1, PARAM_BOOL);
} else {
$forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
}
I am trying to use the array that is defined in lib/filelib.php
This array is already defining all of the file types, and I thought I would be able to just use the element of that array to check whether we want it to force download or not... Back to the books I think.....