public function UploadedFile::getClientOriginalExtension

Returns the original file extension

It is extracted from the original file name that was uploaded. Then is should not be considered as a safe value.

Return value

string The extension

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php, line 130

Class

UploadedFile
A file uploaded through a form.

Namespace

Symfony\Component\HttpFoundation\File

Code

public function getClientOriginalExtension() {
  return pathinfo($this->originalName, PATHINFO_EXTENSION);
}