Forums Register Login

Upload multiple using oreilly

+Pie Number of slices to send: Send
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();
}
}
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 946 times.
Similar Threads
problem with file uploading
image loading
More problems with file uploads
send a file to the server/ multipart request
Reading Multiple files by single submit
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:29:47.