Skip to content
Advertisement

Access File Uploaded Attributes in Laravel 5

I upload a file

In my controller, I did this

JavaScript

I see this

JavaScript

I want to pathname: "/private/var/tmp/phpb73hcy",

I’ve tried

JavaScript

I just want this /private/var/tmp/phpb73hcy

Any hints for me ?

Advertisement

Answer

Use $this->getPathname().

The Laravel UploadedFile class extends the Symfony UploadedFile class, which extends the Symfony File class, which extends the PHP SplFileInfo class. The latter has the getPathname() method.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement