public function FileSystemInterface::getDestinationFilename in Drupal 9
Same name and namespace in other branches
- 8 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.
int $replace: Replace behavior when the destination file already exists.
- FileSystemInterface::EXISTS_REPLACE - Replace the existing file.
- FileSystemInterface::EXISTS_RENAME - Append _{incrementing number} until the filename is unique.
- FileSystemInterface::EXISTS_ERROR - Do nothing and return FALSE.
Return value
string|bool The destination filepath, or FALSE if the file already exists and FileSystemInterface::EXISTS_ERROR is specified.
Throws
\Drupal\Core\File\Exception\FileException Implementation may throw FileException or its subtype on failure.
1 method overrides FileSystemInterface::getDestinationFilename()
- FileSystem::getDestinationFilename in core/
lib/ Drupal/ Core/ File/ FileSystem.php - Determines the destination path for a file.
File
- core/
lib/ Drupal/ Core/ File/ FileSystemInterface.php, line 449
Class
- FileSystemInterface
- Provides an interface for helpers that operate on files and stream wrappers.
Namespace
Drupal\Core\FileCode
public function getDestinationFilename($destination, $replace);