<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <%@page import="java.io.File" %> <title>JSP Page</title> </head> <body> <form method="post" action="upload" enctype="multipart/form-data"> Select file to upload: <input type="file" name="dataFile" id="fileChooser"/><br/><br/> <input type="submit" value="Upload" /> <% String path = "C:/Users/Documents/NetBeansProjects/prac/build/web/data"; String files; File folder = new File(path); File[] listOfFiles = folder.listFiles(); for(int i = 0;i < listOfFiles.length;i++) { if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); if (files.endsWith(".mp3") || files.endsWith(".mp3")) { System.out.println(files); } } } %> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)