# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/pluginfile.php
--- moodle/pluginfile.php Base (1.25)
+++ moodle/pluginfile.php Locally Modified (Based On 1.25)
@@ -510,10 +510,27 @@
     send_file_not_found();
 
 } else if ($context->contextlevel == CONTEXT_BLOCK) {
-    //not supported yet
+
+    if (!$context = get_context_instance_by_id($contextid)) {
     send_file_not_found();
+    }
+    $birecord = $DB->get_record('block_instances', array('id'=>$context->instanceid), '*',MUST_EXIST);
+    $blockinstance = block_instance($birecord->blockname, $birecord);
 
+    if (strpos(get_class($blockinstance), $filearea) !== 0) {
+        send_file_not_found();
+    }
 
+    $itemid = array_shift($args);
+    $filename = array_pop($args);
+    $filepath = '/'.join('/', $args);
+
+    if (method_exists($blockinstance, 'send_file')) {
+        $blockinstance->send_file($context, $filearea, $itemid, $filepath, $filename);
+    }
+
+    send_file_not_found();
+
 } else {
     send_file_not_found();
 }
