0

I need to get Folderpath for selected Folder from my local System using HTML5/JS/Jquery or anything except NODEJS using file browser.

Currently i did using Node-electron but it cause an error in centos (i.e GCC compiler issue it affects other applications)

So i decided to fetch from frontend itself. but i wont able to get folder path currently i am getting relative paths of files presented inside selected folder.

Check this snippet,

$('input[type=file]').change(function () {
    console.log(this.files);
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input type="file" id="fileUpload" webkitdirectory directory multiple>

I want to get basepath for current selected folder. eg: if i select Folder called Employee it should give,

/home/user/Downloads/Employee is there anyway to get this either using jquery?

Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118
  • 3
    Possible duplicate of [How to get full path of selected file on change of using javascript, jquery-ajax?](https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav) – 31piy Apr 06 '18 at 06:51
  • no its not.. i want to get selected path for folder not files. i did it using node but i want to be in pure frontend html/js/jquery – Mohideen bin Mohammed Apr 06 '18 at 06:57
  • Due to security considerations, the requested feature is not allowed. To my knowledge, browsers after IE6 encapsulate this info for security. – jazz Apr 06 '18 at 06:57
  • yes i know that... but i am asking is there a way to do it using any other plugin? – Mohideen bin Mohammed Apr 06 '18 at 07:01
  • Not in a normal website context (because duh, security features you could easily circumvent at will, would not be proper security features to begin with.) You might have more luck with a browser extension or something like that, depending on the actual use case. – CBroe Apr 06 '18 at 07:07
  • This is not possible from the front-end. – Ikhlak S. Apr 06 '18 at 07:15

0 Answers0