function FileSystemInterface::getDestinationFilename

Same name in other branches
  1. 9 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::getDestinationFilename()
  2. 8.9.x core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::getDestinationFilename()
  3. 11.x core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::getDestinationFilename()

Determines the destination path for a file.

Parameters

string $destination: The desired final URI or filepath.

\Drupal\Core\File\FileExists|int $fileExists: Replace behavior when the destination file already exists.

Return value

string|bool The destination filepath, or FALSE if the file already exists and FileExists::Error is specified.

Throws

\Drupal\Core\File\Exception\FileException Implementation may throw FileException or its subtype on failure.

\ValueError Thrown if $fileExists is a legacy int and not a valid value.

File

core/lib/Drupal/Core/File/FileSystemInterface.php, line 453

Class

FileSystemInterface
Provides an interface for helpers that operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function getDestinationFilename($destination, $fileExists);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.