How To Get Real Path Of A File Using Jquery [dupli

2019-07-17 15:39发布

how to get a real path of a file using input type="file" i.e :

HTML Code:

<input type="file" id="fileData"/>

when user click on brows button, he will select a file, so i wanted a path from where he selected. Through Jquery (or any possible way ) if i get a value of 'filedata' i.e:

Jquery :

 var filename = $('#fileData').val();

it gives like this C:\fakepath\SO_Status.xlsx

but what i realy wanted is path of a file and not data inside a file / no need to upload a file C:\filesFolder\SO_Status.xlsx (assuming 'SO_Status.xlsx' file present in fakepath)

1条回答
做个烂人
2楼-- · 2019-07-17 16:35

What are you trying to do is not possible due to security reasons.

Aslo, check this answer: https://stackoverflow.com/a/15201258/706273

查看更多
登录 后发表回答