Saturday, August 18, 2007

Raising Maximum Upload Size in Moodle


I'm posting this because I looked for clear directions on how to do this and could find none. So here goes. If you are using Moodle you have no doubt encountered the default 2mb upload restriction. You have probably also had requests for importation of courses created in other systems (Blackboard). Moodle will import most of the course content from an exported Blackboard course. However, a Blackboard course of any size will be greater than the 2mb upload restriction set by default in Moodle. So, the first thing you will need to do to successfully import a Blackboard course is raise the Moodle upload limit to something more reasonable like 50mb or so.
Here's how I did it:
The upload size limit is set in two places - php and Moodle.
To change maximum upload file size in php:
sudo nano /etc/php5/apache2/php.ini
change post_max_size to 50m
change upload_max_filesize to 50m
exit nano and save the php.ini file
reboot the box

In Moodle
Go to Site Administration>Security>Site policies
Change Maximum uploaded file size maxbytes to something like 50000000 (this actually works out to 47.7mb which was close enough for me)

The one final error I encountered when trying to import (restore) a course from a Blackboard export was that I needed the "xslt" libraries so php could understand the xml (hold on, I'm getting a case of tma). Adding these turned out to be simple but nonetheless, it took me a while to figure it out.
Here's how to do it:
sudo apt-get install php5-xsl
reboot the box
that's it! Back to your regularly scheduled programming...