标签:hashmap val rtc color shm form表单 items 高性能 lse
Map map=new HashMap(); boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (isMultipart) { // 文件上传 // 用stream api处理,提高性能 // System.err.println("file upload request..."); ServletFileUpload upload = new ServletFileUpload(); FileItemIterator fileItemIterator = upload.getItemIterator(request); for (; fileItemIterator.hasNext();) { FileItemStream item = fileItemIterator.next(); String name = item.getFieldName(); System.out.println(name); if (item.isFormField()) { InputStream stream = item.openStream(); // 普通域 String value = Streams.asString(stream, "UTF-8"); if (map.containsKey(name)) { String valueto = (String) map.get(name); valueto += "," + value; map.put(name, valueto); } else { map.put(name, value); } stream.close(); } else { // 文件域 InputStream in = item.openStream();// 获取文件流 } } }
标签:hashmap val rtc color shm form表单 items 高性能 lse
原文地址:https://www.cnblogs.com/fpc-syq/p/8949641.html