From 1fcbd6b5d9938a86f2ad1bceca171567ae52e1c7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 15 Feb 2018 11:57:48 +0300 Subject: server: upload file api method --- juick-server/src/main/java/com/juick/server/api/Post.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server/src/main/java/com') diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java index 7f014d9e..19751d2e 100644 --- a/juick-server/src/main/java/com/juick/server/api/Post.java +++ b/juick-server/src/main/java/com/juick/server/api/Post.java @@ -105,6 +105,10 @@ public class Post { } serverManager.processMessage(visitor, body, attachmentFName); } + @PostMapping("/upload") + public String doUploadFile(@RequestParam(required = true) MultipartFile attach) { + return HttpUtils.receiveMultiPartFile(attach, tmpDir); + } @RequestMapping(value = "/comment", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public com.juick.Message doPostComment( -- cgit v1.2.3