Monday, March 20, 2017

getClientOriginalName() on string when it is an object?

I keep getting the error message

Call to a member function getClientOriginalName() on string

The test.mp4 file exists and is on my localhost. The part I don't understand is that $file is not a string?

$file = File::get(storage_path('app/uploads/test.mp4'));

$original_name = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);

Any help would be appreciated explaining what I am doing wrong.



via Chris Palmer Breuer

Advertisement