jeudi 10 septembre 2020

Access File Uploaded Attributes in Laravel 5

I upload a file

In my controller, I did this

$file = Input::file('file');
dd($file);

I see this

Illuminate\Http\UploadedFile {#1388 ▼
  -test: false
  -originalName: "config-nsd-got.yaml"
  -mimeType: "application/x-yaml"
  -error: 0
  #hashName: null
  path: "/private/var/tmp"
  filename: "phpb73hcy"
  basename: "phpb73hcy"
  pathname: "/private/var/tmp/phpb73hcy" <<<<<<---------- I WANT TO ACCESS THIS
  extension: ""
  realPath: false
  writable: false
  readable: false
  executable: false
  file: false
  dir: false
  link: false
}

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

I've tried

dd($file->pathname());
dd($file["pathname"]);

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

Any hints for me ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire