W3cubDocs

/Drupal 8

public function FileSystemInterface::moveUploadedFile

public FileSystemInterface::moveUploadedFile($filename, $uri)

Moves an uploaded file to a new location.

PHP's move_uploaded_file() does not properly support streams if open_basedir is enabled, so this function fills that gap.

Compatibility: normal paths and stream wrappers.

Parameters

string $filename: The filename of the uploaded file.

string $uri: A string containing the destination URI of the file.

Return value

bool TRUE on success, or FALSE on failure.

See also

move_uploaded_file()

https://www.drupal.org/node/515192

Related topics

PHP wrapper functions
Functions that are wrappers or custom implementations of PHP functions.

File

core/lib/Drupal/Core/File/FileSystemInterface.php, line 30

Class

FileSystemInterface
Provides an interface for helpers that operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function moveUploadedFile($filename, $uri);

© 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!File!FileSystemInterface.php/function/FileSystemInterface::moveUploadedFile/8.1.x