Created
November 29, 2019 15:38
-
-
Save team172011/bc61db7b13bc1a19d0c9c9b5dec215ed to your computer and use it in GitHub Desktop.
Fileupload with Spring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
import org.springframework.web.multipart.MultipartFile; | |
@PostMapping(value= "/projects/{name}/upload", consumes = { "multipart/form-data" }) | |
ResponseEntity<String> addConfigurationAsXml(@PathVariable String name, @RequestPart("file") MultipartFile upfile){ | |
byte[] bytes = upfile.getBytes(); | |
return new ResponseEntity<>("Done..", HttpStatus.OK) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment