public List<FileBean> getFiles(HttpServletRequest request) throws Exception {
if (request instanceof MultipartHttpServletRequest) {
MultipartHttpServletRequest multiReq = (MultipartHttpServletRequest) request;
MultipartFile file = null;
FileBean fileBean = null;
List<FileBean> files = new ArrayList<FileBean>();
for (Object o : multiReq.getFileMap().values()) {
if (o != null) {
file = (MultipartFile) o;
if (!file.isEmpty()) {
fileBean = new FileBean();
fileBean.setName(file.getOriginalFilename());
fileBean.setData(file.getBytes());
files.add(fileBean);
}
}
}
return files;