PHP move_uploaded_file() Function

PHP move_uploaded_file Function


Define :

In this tutorial,we have to learn about move_uploaded_file() Function.The move_uploaded_file() Function is inbuilt funciton in php.

This function moves an uploaded file to a new location and only works on files uploaded via PHP's HTTP POST upload mechanism.

one more thing can be noted If the destination file already exists, it will be overwritten.

Syntax
   move_uploaded_file(file, dest)
Parameters
file Required. Specify the filename of the uploaded file.
dest Required. Specify the destination of the moved file.

Given below example show the usage of  move_uploaded_file() :

Output: hello.txt can not be moved to /php error/hello.txt