How can i get Full path of uploaded file in php. As i uploaded a xml file and clicked on submit button full path of uploaded file will be shown on screen.
HTML
<form action="index.php" method="post" enctype="multipart/form-data">
File: <input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" name="sub" value="Submit">
</form>
PHP
if(isset($_POST['sub']))
{
$file = $_FILES["fileToUpload"]["name"];
$filename = pathinfo($file);
$st_name = $filename['filename'];
$dir= $filename['dirname']; //directory name
echo $dir;
}
Here as i click on submit button output should be like this...
**D://new/folder/file.xml**