function FileTransfer::copyFile

Same name in other branches
  1. 7.x includes/filetransfer/filetransfer.inc \FileTransfer::copyFile()
  2. 9 core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::copyFile()
  3. 8.9.x core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::copyFile()
  4. 11.x core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::copyFile()

Copies a file.

Parameters

string $source: The source file.

string $destination: The destination file.

1 call to FileTransfer::copyFile()
FileTransfer::copyDirectoryJailed in core/lib/Drupal/Core/FileTransfer/FileTransfer.php
Copies a directory.

File

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

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);
}

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