moodle_download_file
Download a Moodle submission or assignment attachment to a local directory and get its saved file path. Existing files are preserved by appending a numbered suffix.
Instructions
Downloads a submission file (or an assignment attachment) to the local disk and returns its path. fileUrl is the url field from moodle_get_submission or moodle_list_assignments. An existing file is not overwritten: " (1)" is appended to the name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destDir | Yes | Absolute path of the directory to save to; created if missing | |
| fileUrl | Yes | Moodle file URL (…/pluginfile.php/…) on this site |