How can we display an Open/Save As dialog box for multiple files?
Multiple files are quite simple to specify. The following JSP demonstrates this:
<html> <head> <title>Download File</title> </head> <body> <form name="DownloadFileForm" action="/mywebapp/servlet/MyServlet" method="post" enctype="multipart/form-data"> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr><td nowrap>File 1: <input name="file1" type="file" size="80"></td></tr> <tr><td nowrap>File 2: <input name="file2" type="file" size="80"></td></tr> <tr><td nowrap>File 3: <input name="file3" type="file" size="80"></td></tr> <tr><td nowrap>File 4: <input name="file4" type="file" size="80"></td></tr> <tr align="center" valign="top"> <td width="100%"> <input type="submit" name="submit" value="Submit" alt="Submit" </td> </tr> </table> </form> </head>You can use Javascript to validate the input fields, if you want to, but gathering the file names is simple HTML.