Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. @RequestMapping(value={"/TestCase/Upload"}, method=RequestMethod.POST)
  2. @ResponseBody
  3. public ResponseEntity<String> uploadFile(HttpServletRequest request,
  4. @RequestParam("file") MultipartFile file) {
  5. System.out.println("Hit this location.");
  6. return new ResponseEntity("Success");
  7. }
  8.  
  9. <servlet>
  10. <servlet-name>spring</servlet-name>
  11. <servlet-class>
  12. org.springframework.web.servlet.DispatcherServlet
  13. </servlet-class>
  14. <load-on-startup>1</load-on-startup>
  15. <!-- Configuration for file upload (configuring Multipart file) -->
  16. <multipart-config>
  17. <location>/tmp</location>
  18. <max-file-size>500000</max-file-size>
  19. <max-request-size>505000</max-request-size>
  20. <file-size-threshold>10485</file-size-threshold>
  21. </multipart-config>
  22. </servlet>
  23.  
  24. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  25. <property name="maxUploadSize" value="500000" />
  26. </bean>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement