8.5.x file.inc drupal_move_uploaded_file($filename, $uri)
8.0.x file.inc drupal_move_uploaded_file($filename, $uri)
8.1.x file.inc drupal_move_uploaded_file($filename, $uri)
8.2.x file.inc drupal_move_uploaded_file($filename, $uri)
8.3.x file.inc drupal_move_uploaded_file($filename, $uri)
8.4.x file.inc drupal_move_uploaded_file($filename, $uri)
8.6.x file.inc drupal_move_uploaded_file($filename, $uri)
7.x file.inc drupal_move_uploaded_file($filename, $uri)

Moves an uploaded file to a new location.

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::moveUploadedFile().

Related topics

File

core/includes/file.inc, line 923
API for handling file uploads and server file management.

Code

function drupal_move_uploaded_file($filename, $uri) {
  return \Drupal::service('file_system')
    ->moveUploadedFile($filename, $uri);
}