Skip to content

Commit 4efe705

Browse files
joshuadegierstreamtw
authored andcommitted
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).
1 parent 33574e1 commit 4efe705

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controllers/UploadController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ private function proceedSingleUpload($file)
6161

6262
$this->makeThumb($new_filename);
6363
} else {
64-
chmod($file->path(), 0644); // TODO configurable
65-
File::move($file->path(), $new_file_path);
64+
chmod($file->getRealPath(), 0644); // TODO configurable
65+
File::move($file->getRealPath(), $new_file_path);
6666
}
6767
} catch (\Exception $e) {
6868
return parent::error('invalid');

0 commit comments

Comments
 (0)