Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folder Choose in Html [closed]

Tags:

html

I just want users select folder path.

For example;

User choose 'D:/example/' folder.

Then im save 'D:/example/' to my database.

<input type='file'> doesnt work for me . I just need folder path

How can i do that ?

Edit: Everyone show this for answer

but this is not my question. It listing directory.

I just want folder path like d:/asd/ user pick asd folder on d.

so i save my database to 'd:/asd/' .just this

I dont know how can i explain more.

like image 212
ozgursana Avatar asked Feb 07 '16 23:02

ozgursana


People also ask

What is Webkitdirectory?

webkitdirectory is a property that reflects the webkitdirectory HTML attribute and indicates that the <input> element should let the user select directories instead of files. When a directory is selected, the directory and its entire hierarchy of contents are included in the set of selected items.

How do I create a folder in HTML code?

To create a folder, go to the Page Settings → Additional → Create new folder. You can place any page in the folder, except for your website's Home Page, Header, and Footer.

What is a folder in HTML?

HTML file paths are used to define the file's location, which will be used as an external resource within the HTML document. The location of the file is specified as per the structure of the web folder. External resources such as CSS files, script files, images, multimedia, etc. can be linked to an HTML document.


1 Answers

I hope this can help you

you can see the folder name in alert when select a file

<script type="text/javascript">
  function getfolder(e) {
    var files = e.target.files;
    var path = files[0].webkitRelativePath;
    var Folder = path.split("/");
    alert(Folder[0]);
  }
</script>

<input type="file" id="flup" onchange="getfolder(event)" webkitdirectory mozdirectory msdirectory odirectory directory multiple />
like image 152
Muhammet Demir Avatar answered Sep 30 '22 18:09

Muhammet Demir