You are here

public function FileMetadata::copyTempToUri in File metadata manager 8

Same name and namespace in other branches
  1. 8.2 src/FileMetadata.php \Drupal\file_mdm\FileMetadata::copyTempToUri()

Copies the local temporary file to the destination URI.

Return value

bool TRUE if the file was copied successfully, FALSE otherwise.

Overrides FileMetadataInterface::copyTempToUri

File

src/FileMetadata.php, line 133

Class

FileMetadata
A file metadata object.

Namespace

Drupal\file_mdm

Code

public function copyTempToUri() {
  if (($temp_path = $this
    ->getLocalTempPath()) === NULL) {
    return FALSE;
  }
  return (bool) file_unmanaged_copy($temp_path, $this
    ->getUri(), FILE_EXISTS_REPLACE);
}