code for moodle file downloader