alexanoid alexanoid - 1 year ago 134
Java Question

Spring RestController submit file

As a part of a client request - image file must be submitted to my Spring


Is it possible to use
@RequestParam("file") MultipartFile file

If so, could you please show an example.

Answer Source

Yes, it is possible and quite simple:

public void upload(@RequestParam("file") MultipartFile file){
  //Do what you like with the file
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download