Search in sources :

Example 1 with CommonsMultipartResolver

use of org.springframework.web.multipart.commons.CommonsMultipartResolver in project gocd by gocd.

the class FakeArtifactPublisherServlet method doPost.

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
    MultipartHttpServletRequest httpServletRequest = multipartResolver.resolveMultipart(request);
    Map<String, MultipartFile> map = httpServletRequest.getFileMap();
    MultipartFile multipartFile = map.values().iterator().next();
    receivedFiles.add(multipartFile.getOriginalFilename());
}
Also used : MultipartFile(org.springframework.web.multipart.MultipartFile) CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) MultipartHttpServletRequest(org.springframework.web.multipart.MultipartHttpServletRequest)

Example 2 with CommonsMultipartResolver

use of org.springframework.web.multipart.commons.CommonsMultipartResolver in project symmetric-ds by JumpMind.

the class RestConfig method multipartResolver.

@Bean
public MultipartResolver multipartResolver() {
    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
    multipartResolver.setMaxUploadSize(50000000);
    return multipartResolver;
}
Also used : CommonsMultipartResolver(org.springframework.web.multipart.commons.CommonsMultipartResolver) Bean(org.springframework.context.annotation.Bean)

Aggregations

CommonsMultipartResolver (org.springframework.web.multipart.commons.CommonsMultipartResolver)2 Bean (org.springframework.context.annotation.Bean)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1 MultipartHttpServletRequest (org.springframework.web.multipart.MultipartHttpServletRequest)1