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 />