Hi all,
Please help!
I am now using oreilly to upload files to my server.....
Everything works fine when I only upload 1 file, but when I upload multiple files using the same name, i.e. using the (id="more_link2") to get dynamic upload files
<form action="xx_upload.jsp" encType="multipart/form-data" id="FORM1" method="post" name="FORM1">
<input type="file" id="more_link2" name="more_link2" size="12" style="font-size:12pt;font-family:arial">
For example if I upload 3 files, from oreilly I can save 3 files into my destination path, but I only get the last file details (f.getName, f.length)
My code i as below.....
mreq = new lm5ai.file.MultipartRequest(request,pri_temp_upload, MaxUploadSize);
Enumeration files = mreq.getFileNames();
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = mreq.getFilesystemName(name);
String type = mreq.getContentType(name);
File f = mreq.getFile(name);
out.println("name: " + name+"<br>");
out.println("filename: " + filename+"<br>");
out.println("type: " + type+"<br>");
if (f != null) {
out.println("<br>f.toString(): " + f.toString());
out.println("<br>f.getName(): " + f.getName());
out.println("<br>f.exists(): " + f.exists());
out.println("<br>f.length(): " + f.length());
out.println();
}
}
Please help!
I am now using oreilly to upload files to my server.....
Everything works fine when I only upload 1 file, but when I upload multiple files using the same name, i.e. using the (id="more_link2") to get dynamic upload files
<form action="xx_upload.jsp" encType="multipart/form-data" id="FORM1" method="post" name="FORM1">
<input type="file" id="more_link2" name="more_link2" size="12" style="font-size:12pt;font-family:arial">
For example if I upload 3 files, from oreilly I can save 3 files into my destination path, but I only get the last file details (f.getName, f.length)
My code i as below.....
mreq = new lm5ai.file.MultipartRequest(request,pri_temp_upload, MaxUploadSize);
Enumeration files = mreq.getFileNames();
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = mreq.getFilesystemName(name);
String type = mreq.getContentType(name);
File f = mreq.getFile(name);
out.println("name: " + name+"<br>");
out.println("filename: " + filename+"<br>");
out.println("type: " + type+"<br>");
if (f != null) {
out.println("<br>f.toString(): " + f.toString());
out.println("<br>f.getName(): " + f.getName());
out.println("<br>f.exists(): " + f.exists());
out.println("<br>f.length(): " + f.length());
out.println();
}
}