From 4efe7057b6a7d7a5feccf9e2fb68146758fd7a8c Mon Sep 17 00:00:00 2001 From: Pendo Date: Thu, 18 May 2017 03:41:19 +0200 Subject: [PATCH] Changed path() method to getRealPath() (#300) Uploading a regular file using laravel-filemanager causes this error: `Call to undefined method Symfony\Component\HttpFoundation\File\UploadedFile::path()` According to other places inside the code, the correct method should be `getRealPath()`, after changing both references in the UploadController I was able to upload files without issues. The error only occured when uploading using the "Files" type of the file manager (like a PDF). --- src/controllers/UploadController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/UploadController.php b/src/controllers/UploadController.php index 1e3773b9..90a033c3 100644 --- a/src/controllers/UploadController.php +++ b/src/controllers/UploadController.php @@ -61,8 +61,8 @@ private function proceedSingleUpload($file) $this->makeThumb($new_filename); } else { - chmod($file->path(), 0644); // TODO configurable - File::move($file->path(), $new_file_path); + chmod($file->getRealPath(), 0644); // TODO configurable + File::move($file->getRealPath(), $new_file_path); } } catch (\Exception $e) { return parent::error('invalid');