Forums Register Login
Is there any way to do check how many files the user have uploaded?
I am quite new to jsp and I want to ask for advice.
I have a form as below in multiUpload.html for users to upload files:
<form action="multi_action.jsp" enctype="MULTIPART/FORM-DATA" method="post">
Select file1 to upload <input type="file" name="filename1"><br>
Select file2 to upload <input type="file" name="filename2"><br>
Select file3 to upload <input type="file" name="filename3"><br>
Select file4 to upload <input type="file" name="filename4"><br>
Select file5 to upload <input type="file" name="filename5"><br>
<input type="submit" value="Upload"><br>
In the page multi_action.jsp, i use the following code but cannot check how many files the user have uploaded, no is null when print out.
String files;
int fileCnt = 1;
int no = 0;
While (fileCnt < 6) {
files = request.getParameter("filename" + fileCnt);
if (files!=null) {
out.println("no: " + no);
Is there any way to do check how many files the user have uploaded?
thx for advice.
look! it's a bird! it's a plane! It's .... a teeny tiny ad
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 1097 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 16, 2019 11:43:25.