Skip to content

Commit

Permalink
image extension fix
Browse files Browse the repository at this point in the history
  • Loading branch information
portey committed Oct 3, 2016
1 parent 192368d commit 68bca1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Service/Loader/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Youshido\ApiImagesBundle\Service\Loader;

use Gaufrette\Adapter;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Youshido\ApiImagesBundle\Traits\FilesystemTrait;
Expand All @@ -32,7 +31,8 @@ public function __construct($subFolders = 2)
*/
public function upload(UploadedFile $file)
{
$filename = $this->generateFilePath($file->getClientOriginalExtension());
$extension = $file->getClientOriginalExtension() ?: $file->guessExtension();
$filename = $this->generateFilePath($extension ?: ''); //rething logic here

$this->getFilesystem()->write($filename, $this->getContent($file->getPathname()));

Expand Down

0 comments on commit 68bca1d

Please sign in to comment.