Title / Description
Code Public void upload(HttpServletRequest request) throws ServletException { MultipartHttpServletRequest mRequest = (MultipartHttpServletRequest) request; String next = (String) mRequest.getFileNames().next(); MultipartFile file = mRequest.getFile(next); if (file == null) return; if (fileName != null) { if (fileName.endsWith(".docx") || fileName.endsWith(".pptx") || fileName.endsWith(".pdf") || fileName.endsWith(".xlsx")){ /* file upload routine*/ }else throw new ServletExeption("error"); }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code