Commit 7867da22 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

File downloading stuff from moodle

parent f83a41c9
This diff is collapsed.
......@@ -1052,4 +1052,18 @@ function get_dir_contents($directory) {
return $contents;
function serve_file($file, $filename) {
if (!file_exists($file)) {
header('HTTP/1.0 404 Not Found');
// Moodle security stuff went here...
session_write_close(); // unlock session during fileserving
send_file($file, $filename);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment