I want to rename file dynamically and then upload it. I am fetching name of file from DB. But when I rename file it\'s not taking name value coming from DB. It\'s considerin
Try this:
<?php
include("uploadId.php");
$temp = explode(".", $_FILES["uploaded_file"]["name"]);
$extension = end($temp);
$path="/var/www/tcpdf/pictures/";
$filename = basename($_FILES["uploaded_file"]["name"]);
$filename = $_SESSION['id'] . strrchr($filename, '.') . $extension;
if(move_uploaded_file($_FILES["uploaded_file"]["tmp_name"],$path . $filename))
{
echo "Uploaded";
}
?>