From 24382a1e65b85be854c0e2b2fcaba0ae69fcda92 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Sat, 14 Mar 2015 13:58:09 +0100 Subject: [PATCH] files type --- src/Services/Upload/FileUpload.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Services/Upload/FileUpload.php b/src/Services/Upload/FileUpload.php index 9f7962e2..26ebb30f 100644 --- a/src/Services/Upload/FileUpload.php +++ b/src/Services/Upload/FileUpload.php @@ -37,6 +37,11 @@ public function handle(UploadedFile $file, $path = 'uploads') $fileTypes = Config::get('file.types'); $input['type'] = $fileTypes[strtolower($file->getClientOriginalExtension())]; + try { + $input['type'] = $fileTypes[strtolower($file->getClientOriginalExtension())]; + } catch (Exception $e) { + $input['type'] = 'd'; + } $filecounter = 1; while (file_exists($input['path'] . '/' . $input['filename'])) {