Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #rename #file #saving
ADD COMMENT
Topic
Name
5+8 =