0

Helo everyone. I try to make simple media library and have strange issue during svg upload. here are my controller method:

$file = $request->file('image');
            $data['name'] = $file->store('/media/original', 'public');
            $data['mime_type'] = $file->getMimeType();
            $data['file_size'] = $file->getSize();
            $data['file_status'] = 1;

            Gallery::create($data);

A problem is svg stores with .html extension. $file->getMimeType(); returns text/plain

Andrii
  • 324
  • 3
  • 16
  • Possible duplicate of [PHP Mime type checking alternative way of doing it?](https://stackoverflow.com/questions/8225644/php-mime-type-checking-alternative-way-of-doing-it) – Naruto Oct 10 '17 at 13:51
  • 1
    please go through https://github.com/directus/directus/issues/1166 i think you may get some help regarding this issue – ajith mohan Oct 10 '17 at 13:56

0 Answers0