Skip to content

Commit

Permalink
Merge pull request #1126 from BFoucher/fix-media-svg-upload
Browse files Browse the repository at this point in the history
use default MimeTypeGuesser
  • Loading branch information
paulandrieux authored May 15, 2019
2 parents 8e7a938 + 4820210 commit 5440345
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Bundle/MediaBundle/Helper/File/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Gedmo\Sluggable\Util\Urlizer;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
use Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Victoire\Bundle\MediaBundle\Entity\Media;
Expand Down Expand Up @@ -41,8 +41,7 @@ class FileHandler extends AbstractMediaHandler
public function __construct()
{
$this->fileSystem = new Filesystem(new \Gaufrette\Adapter\Local('uploads/media/', true));
//we use a specific symfony mimetypeguesser because de default (FileinfoMimeTypeGuesser) is unable to recognize MS documents
$this->mimeTypeGuesser = new FileBinaryMimeTypeGuesser();
$this->mimeTypeGuesser = new FileinfoMimeTypeGuesser();
$this->urlizer = new Urlizer();
}

Expand Down

0 comments on commit 5440345

Please sign in to comment.