Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UploadedFile.php

function UploadedFile::getClientOriginalExtension

Returns the original file extension.

It is extracted from the original file name that was uploaded. This should not be considered as a safe value to use for a file name on your servers.

File

vendor/symfony/http-foundation/File/UploadedFile.php, line 95

Class

UploadedFile
A file uploaded through a form.

Namespace

Symfony\Component\HttpFoundation\File

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal