Skip to content

Commit

Permalink
Changed path() method to getRealPath() (#300)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
joshuadegier authored and streamtw committed May 18, 2017
1 parent 33574e1 commit 4efe705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 4efe705

Please sign in to comment.