/**
* Extract the file information from the uploaded file, into the internal properties
*/
private function setFileInfo() { if ($this->file === null
) { return;
} $extension =
(string) $this->file->
guessExtension();
$name =
$this->file->
getBasename();
if ($this->file instanceof UploadedFile
) { // Load file information
$fileInfo =
pathinfo($this->file->
getClientOriginalName());
$name =
$fileInfo['filename'
];
if (isset($fileInfo['extension'
])) { $extension =
$fileInfo['extension'
];
} }