Last active
June 29, 2017 09:55
-
-
Save xyulex/bc31c92a10bf3dd9362b0425a0225eb5 to your computer and use it in GitHub Desktop.
MOODLE: Descargar fichero externo y grabarlo en el Moodle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$record = new StdClass(); | |
$record->course = $courseid; | |
$record->contextid = $usercontextid; | |
$record->userid = $USER->id; | |
$record->component = 'user'; | |
$record->filearea = 'draft'; | |
$record->itemid = $draftitemid; | |
$record->filename = $scormFilename; | |
$record->filepath = '/'; | |
$fgc = file_get_contents($'http://www.raul.com/wp-content/'.$scormFilename); | |
if ($fgc) { | |
$fs->create_file_from_string($record, $fgc); // Guardar | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment