commit
0a9aa5a783
|
@ -132,11 +132,18 @@ class H5PDefaultStorage implements \H5PFileStorage {
|
|||
* Path on file system to temporary export file.
|
||||
* @param string $filename
|
||||
* Name of export file.
|
||||
* @throws Exception Unable to save the file
|
||||
*/
|
||||
public function saveExport($source, $filename) {
|
||||
$this->deleteExport($filename);
|
||||
self::dirReady("{$this->path}/exports");
|
||||
copy($source, "{$this->path}/exports/{$filename}");
|
||||
|
||||
if (!self::dirReady("{$this->path}/exports")) {
|
||||
throw new Exception("Unable to create directory for H5P export file.");
|
||||
}
|
||||
|
||||
if (!copy($source, "{$this->path}/exports/{$filename}")) {
|
||||
throw new Exception("Unable to save H5P export file.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1595,6 +1595,7 @@ Class H5PExport {
|
|||
}
|
||||
catch (Exception $e) {
|
||||
$this->h5pF->setErrorMessage($this->h5pF->t($e->getMessage()));
|
||||
return false;
|
||||
}
|
||||
|
||||
unlink($tmpFile);
|
||||
|
|
Loading…
Reference in New Issue