Answers for "php how to rename a file before saving it"

PHP
0

php how to rename a file before saving it

$temp = explode(".", $_FILES["file"]["name"]);
$newfilename = round(microtime(true)) . '.' . end($temp);
move_uploaded_file($_FILES["file"]["tmp_name"], "../img/imageDirectory/" . $newfilename);
Posted by: Guest on July-28-2020

Code answers related to "php how to rename a file before saving it"

Browse Popular Code Answers by Language