Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<body>

<audio controls="">

<%

%>


Your browser does not support the audio element.



<%

String webTempPath = "D:\\nameoffolder" + "\\" + (session.getAttribute("uname"));


String path = webTempPath.toString();

String files;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();


out.println("");
out.println("<head>");
out.println("
");
out.println("MY PLAYLIST");
out.println("</head>");




for (int i = 0; i < listOfFiles.length; i++) {

if (listOfFiles[i].isFile())
{
files = listOfFiles[i].getName();
if (files.endsWith(".mp3"))
{
out.println("");
out.println("");
out.println("");
}
}

out.println("
");
// out.println(files);
// out.println(i+1);

// out.println("
");
}

%>




</body>

</body>
</html>


using out.print(files) i have fetched all the audio files and made a hyperlink but i cannot play audio files on selecting particular hyperlink
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900