Q: How to get proper path of uploading file in PHP When I select a file or folder through input field I am not getting the proper path in PHP.
HTML:
<input type="file" name="dirpath"  id="dirname" webkitdirectory directory multiple>

PHP code:
if(isset($_FILES['dir']))
{
    $name = file_get_contents($_FILES['dir']['tmp_name']);  
    echo '<pre>';
    print_r($name);
}

here, getting fake path like C:\fakepath\123.pdf
but actual File path I want to like this way:

path: "C:\Users\Prashan\Desktop\pdf\123.pdf"

How to find the absolute path of the file?

A: The information you are trying to get from the Uploaded file is never revealed to the client.
Also, PHP is server side programming language. It means the data and everything will is working by the server/computer and the browser has no power to edit it. It receives only data and the server will work with it (with what you coded).
If you want to open the file **without** sending it to the **server**:
This answer will help you
