1

I have this simple question:

how is possible to retrieve the absolute path of file just saved with laravel?

for example:

I saved the file with:

$filename = $request->file('video')->getClientOriginalName();
$file = $request->file('video')->storeAs('public/video', $filename);

I would like to get the absolute path to this.


With storage_path():

If I use the method storage_path() I can get the full path to the link of the file but not to the file on disk.

with this method I get:

/Users/MYUSER/laravel/storage/public/video/a.mp4

but should be:

/Users/MYUSER/laravel/storage/app/public/video/a.mp4
Angus Simons
  • 457
  • 1
  • 5
  • 22

0 Answers0