This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Is there any way to do check how many files the user have uploaded? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is there any way to do check how many files the user have uploaded?" Watch "Is there any way to do check how many files the user have uploaded?" New topic
Author

Is there any way to do check how many files the user have uploaded?

chiu pong
Greenhorn

Joined: Aug 11, 2003
Posts: 11
hi,
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>
</form>
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) {
no++;
}
fileCnt++;
}
out.println("no: " + no);
%>
Is there any way to do check how many files the user have uploaded?
thx for advice.
ypc
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there any way to do check how many files the user have uploaded?
 
Similar Threads
FileUpload with Orion Package
Help in Multipart Request Urgent
sending a servlet parameters
Array Index Out Of Bounds
upload file question