上传时,怎么将多个图片同时进行上传,因为我获取的时候这样
:SmartUpload mySmartUpload = new SmartUpload();
try {
mySmartUpload.initialize(getServletConfig(), request, response);
mySmartUpload.setMaxFileSize(5120000);
mySmartUpload.setAllowedFilesList("jpg,JPG");
mySmartUpload.upload();
} catch (Exception e) {
response.sendRedirect("/Wendy2/error.jsp");
return;
}
com.jspsmart.upload.File file = mySmartUpload.getFiles().getFile(0);
String filename = "";
try {
String name = file.getFileName();
int pos = name.indexOf(".");
String type = name.substring(pos, name.length());
long time = new Date().getTime();
filename = "zhongcheng" + time + type;
file.saveAs("/upload/" + filename);
} catch (Exception e1) {
response.sendRedirect("../error.jsp");
return;
}
我要将filename存到数据库中,是这样的吧,但是我现在想同时多存几个图片,不知道要怎么修改,请大家指导下