Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value={"/TestCase/Upload"}, method=RequestMethod.POST)
- @ResponseBody
- public ResponseEntity<String> uploadFile(HttpServletRequest request,
- @RequestParam("file") MultipartFile file) {
- System.out.println("Hit this location.");
- return new ResponseEntity("Success");
- }
- <servlet>
- <servlet-name>spring</servlet-name>
- <servlet-class>
- org.springframework.web.servlet.DispatcherServlet
- </servlet-class>
- <load-on-startup>1</load-on-startup>
- <!-- Configuration for file upload (configuring Multipart file) -->
- <multipart-config>
- <location>/tmp</location>
- <max-file-size>500000</max-file-size>
- <max-request-size>505000</max-request-size>
- <file-size-threshold>10485</file-size-threshold>
- </multipart-config>
- </servlet>
- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
- <property name="maxUploadSize" value="500000" />
- </bean>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement