MDL-58219 googledocs: Use google file extensions

Only rename on export for download.

Part of MDL-58220
This commit is contained in:
Damyon Wiese 2017-03-14 14:20:16 +08:00
parent 72643dc688
commit af28b22892
3 changed files with 34 additions and 8 deletions

View file

@ -278,6 +278,10 @@ switch ($action) {
} else {
// Download file to moodle.
$downloadedfile = $repo->get_file($reference, $saveas_filename);
if (!empty($downloadedfile['newfilename'])) {
$record->filename = $downloadedfile['newfilename'];
}
if (empty($downloadedfile['path'])) {
$err->error = get_string('cannotdownload', 'repository');
die(json_encode($err));