Skip to content

Commit

Permalink
extended mimetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Antipkin-A committed Mar 6, 2023
1 parent d49820f commit 0bbc6ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ public function request($url, $method = 'GET', $options = []): Response
'oform' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'epub' => 'application/epub+zip',
'fb2' => 'text/fb2+xml',
'html' => 'text/html',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
Expand Down
2 changes: 1 addition & 1 deletion controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function actionSaveas()
$file = new File();
$file->file_name = $filename;
$file->size = mb_strlen($newContent, '8bit');
$file->mime_type = $this->module->mimes[$fileExt];
$file->mime_type = isset($this->module->mimes[$fileExt]) ? $this->module->mimes[$fileExt] : 'application/octet-stream';
$file->save();
$file->getStore()->setContent($newContent);

Expand Down

0 comments on commit 0bbc6ee

Please sign in to comment.