throw new file_exception('storedfilecannotread', '', $pathname);
}
}
- $mimetype = $this->fs->mimetype($pathname);
+ $mimetype = $this->fs->mimetype($pathname, $this->file_record->filename);
$this->file_record->mimetype = $mimetype;
$DB->update_record('files', $this->file_record);
if ($this->mimetypes != '*') {
// check filetype
- $filemimetype = file_storage::mimetype($_FILES[$elname]['tmp_name']);
+ $filemimetype = file_storage::mimetype($_FILES[$elname]['tmp_name'], $record->filename);
if (!in_array($filemimetype, $this->mimetypes)) {
throw new moodle_exception('invalidfiletype', 'repository', '', get_mimetype_description(array('filename' => $_FILES[$elname]['name'])));
}