I was trying to get the title and artist (and other metadata eventually) of each mp3 file in a directory. Currently the code I have appends the div "thelist" with the file name of the mp3 file. How could I go about getting the title and artist properties/tags of the file instead of the entire file name?
Here is my code:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Get Directory</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#file-input").on("change", function(e){
var thefiles = e.target.files;
$.each(thefiles, function(i, item){
var thefile = item;
$("#thelist").append("FILES: " + thefile.name + "<br />");;
});
});
});
</script>
</head>
<body>
<input type="file" id="file-input" webkitdirectory="" directory="">
<div id="thelist"></div>
</body>
</html>