看不懂程序
boolean isMultipart = FileUpload.isMultipartContent(iRequest);
// Create a factory for disk-based file items
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
if ( !theRTEUploadDir.isDirectory() )
{
theRTEUploadDir.mkdirs();
}
// Parse the request
List items = upload.parseRequest(iRequest);
Iterator iter = items.iterator();
FileItem item = (FileItem)iter.next();
String name = item.getFieldName();
if ( name.equals("coursezipfile") )
誰能解釋解釋
------解决方案--------------------这一段是通过迭代器(iter)读取items的值,其中的迭代器位置是在将要读取的数的前面,所以要用到iter.next()来读取当前位置的值,item对象应该把相应的值带过来了
------解决方案--------------------用迭代器取出list中的数据