W3cubDocs

/Drupal 8

public final function FileTransfer::copyFile

public final FileTransfer::copyFile($source, $destination)

Copies a file.

Parameters

string $source: The source file.

string $destination: The destination file.

File

core/lib/Drupal/Core/FileTransfer/FileTransfer.php, line 181

Class

FileTransfer
Defines the base FileTransfer class.

Namespace

Drupal\Core\FileTransfer

Code

public final function copyFile($source, $destination) {
  $source = $this->sanitizePath($source);
  $destination = $this->fixRemotePath($destination);
  $this->checkPath($destination);
  $this->copyFileJailed($source, $destination);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!FileTransfer!FileTransfer.php/function/FileTransfer::copyFile/8.1.x