How to extract all the way when user uploads file using jquery

I am trying to extract the entire path to the file that the user loads in the browser, and this needs to be done using javascript or jquery.

If I give ($("#userfile").val());, I can extract only the file name, not the whole path.

Can someone help me with this?

+3
source share
4 answers

I believe that this is a security measure so as not to reveal the entire file input path.

+2
source

Internet explorer will give you the full path, but other browsers will not. here is an example of the page i found that demonstrates this

+2
source

IE8 . IE8 , , :

C:\\**fakepath**\filename
+1

as stated above, this is usually a resolution issue. try and move the file to another area and give it full permissions.

var path = $('#file').attr("value");

this will also give you the file path

+1
source

Source: https://habr.com/ru/post/1705164/


All Articles