Get the AbsolutePath of the input type="file"

2

I'm trying to get the full directory path through the file type input, but so far I can only get a previous folder, for example, I have the folder in the path C: / user / Documents / Images / Yesterday so I would like to I can get the whole path, but I can only get the folder Yesterday, the code I'm doing is

$('#pasta').change(
    function absolutepath(e){   
    var aqrs;
    var theFiles = e.target.files;
    alert(theFiles[0].webkitRelativePath);
});

With this code above it pick up the first file with the folder with the input below:

<input type="file" id="pasta"  multiple webkitdirectory />

How do I get the whole route?

    
asked by anonymous 06.01.2016 / 02:50

1 answer

4

Not possible.

For security reasons browsers do not let you know the Absolute Path of the user's file.

And you can only view the name of the previous folder because the webkitdirectory property returns the relative path of your folder.

  

According to the HTML5 specification, a non-uploaded upload control   should reveal the actual path of the selected file. 1

1 THE MYSTERY OF C: \ FAKEPATH UNVEILED

    
06.01.2016 / 03:44